SOAP
[ class tree: SOAP ] [ index: SOAP ] [ all elements ]

Source for file hexBinary.php

Documentation is available at hexBinary.php

  1. <?php
  2. /**
  3.  * This class provides methods to detect and convert binary data from an to
  4.  * hexadecimal strings.
  5.  *
  6.  * PHP versions 4 and 5
  7.  *
  8.  * LICENSE: This source file is subject to version 2.02 of the PHP license,
  9.  * that is bundled with this package in the file LICENSE, and is available at
  10.  * through the world-wide-web at http://www.php.net/license/2_02.txt.  If you
  11.  * did not receive a copy of the PHP license and are unable to obtain it
  12.  * through the world-wide-web, please send a note to license@php.net so we can
  13.  * mail you a copy immediately.
  14.  *
  15.  * @category   Web Services
  16.  * @package    SOAP
  17.  * @author     Dietrich Ayala <dietrich@ganx4.com> Original Author
  18.  * @author     Shane Caraveo <Shane@Caraveo.com>   Port to PEAR and more
  19.  * @copyright  2003-2007 The PHP Group
  20.  * @license    http://www.php.net/license/2_02.txt  PHP License 2.02
  21.  * @link       http://pear.php.net/package/SOAP
  22.  */
  23.  
  24.     function to_bin($value)
  25.     {
  26.         return pack('H' strlen($value)$value);
  27.     }
  28.  
  29.     function to_hex($value)
  30.     {
  31.         return bin2hex($value);
  32.     }
  33.  
  34.     function is_hexbin($value)
  35.     {
  36.         // First see if there are any invalid chars.
  37.         if (!strlen($value|| preg_match('/[^A-Fa-f0-9]/'$value)) {
  38.             return false;
  39.         }
  40.  
  41.         return strcasecmp($valueSOAP_Type_hexBinary::to_hex(SOAP_Type_hexBinary::to_bin($value))) == 0;
  42.     }
  43.  
  44. }

Documentation generated on Mon, 11 Mar 2019 15:47:18 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.