hex2asc() 공개 정적인 메소드

Converts all hexadecimal expressions ("\HEX") to their original ASCII characters.
저자: beni@php.net, heavily based on work from DavidSmith@byu.net
public static hex2asc ( string $string ) : string
$string string String to convert.
리턴 string ASCII representation of $string.
예제 #1
0
파일: UtilTest.php 프로젝트: horde/horde
 /**
  * Test HEX unescaping
  */
 public function testHex2asc()
 {
     $expected = '';
     for ($i = 0; $i < 127; $i++) {
         $expected .= chr($i);
     }
     $str = '\\00\\01\\02\\03\\04\\05\\06\\07\\08\\09\\0a\\0b\\0c\\0d\\0e\\0f\\10\\11\\12\\13\\14\\15\\16\\17\\18\\19\\1a\\1b\\1c\\1d\\1e\\1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~';
     $this->assertEquals($expected, Horde_Ldap_Util::hex2asc($str));
 }