Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Unicode.php
Go to the documentation of this file.
1 <?php
25 #require_once 'Zend/Text/Table/Decorator/Interface.php';
26 
37 {
43  public function getTopLeft()
44  {
45  return $this->_uniChar(0x250C);
46  }
47 
53  public function getTopRight()
54  {
55  return $this->_uniChar(0x2510);
56  }
57 
63  public function getBottomLeft()
64  {
65  return $this->_uniChar(0x2514);
66  }
67 
73  public function getBottomRight()
74  {
75  return $this->_uniChar(0x2518);
76  }
77 
83  public function getVertical()
84  {
85  return $this->_uniChar(0x2502);
86  }
87 
93  public function getHorizontal()
94  {
95  return $this->_uniChar(0x2500);
96  }
97 
103  public function getCross()
104  {
105  return $this->_uniChar(0x253C);
106  }
107 
113  public function getVerticalRight()
114  {
115  return $this->_uniChar(0x251C);
116  }
117 
123  public function getVerticalLeft()
124  {
125  return $this->_uniChar(0x2524);
126  }
127 
133  public function getHorizontalDown()
134  {
135  return $this->_uniChar(0x252C);
136  }
137 
143  public function getHorizontalUp()
144  {
145  return $this->_uniChar(0x2534);
146  }
147 
154  protected function _uniChar($code)
155  {
156  if ($code <= 0x7F) {
157  $char = chr($code);
158  } else if ($code <= 0x7FF) {
159  $char = chr(0xC0 | $code >> 6)
160  . chr(0x80 | $code & 0x3F);
161  } else if ($code <= 0xFFFF) {
162  $char = chr(0xE0 | $code >> 12)
163  . chr(0x80 | $code >> 6 & 0x3F)
164  . chr(0x80 | $code & 0x3F);
165  } else if ($code <= 0x10FFFF) {
166  $char = chr(0xF0 | $code >> 18)
167  . chr(0x80 | $code >> 12 & 0x3F)
168  . chr(0x80 | $code >> 6 & 0x3F)
169  . chr(0x80 | $code & 0x3F);
170  } else {
171  return false;
172  }
173 
174  return $char;
175  }
176 }
$code
Definition: info.phtml:12