title: pack() in php. Illegal hex digit warning
body: <p>i am having some problems using pack() in php </p>
  
  <pre><code>$currencypair = "EUR/USD";
  $buy_sell = "buy";
  $alert_device_token =array("a","a","b");
  $message = "Your " . $currencypair . " " . $buy_sell . " alert price has been reached!";
  $payload['aps'] = array (
    'alert' =&gt; $message,
    'badge' =&gt; 1,
    'sound' =&gt; 'default'
  );
  $payload = json_encode($payload);
  
  foreach ($alert_device_token as $alert_device)
  {
    $apnsMessage = chr(0) . chr(0) . chr(32) . 
                   pack('H*', str_replace(' ', '', $alert_device)) . 
                   chr(0) . chr(strlen($payload)) . $payload;
    echo $apnsMessage;
  }
  </code></pre>
  
  <p>Now sometimes i get following warnings running the same code - </p>
  
  <pre><code>Warning: pack() [function.pack]: Type H: illegal hex digit g in /code/FR2BVl
  </code></pre>
  
  <p>the illegal hex digit keeps varying though. Any ideas about this warning and ways to remove it.</p>
  
  <p>check it live <a href="http://codepad.viper-7.com/FR2BVl" rel="noreferrer">here</a>  </p>