convert image to byte array
<p>i want convert image into byte array in php.actually i am accessing web service in dot net.where i want to pass image as byte array.i tried this code</p>

<pre><code>  $data1 = file_get_contents("upload/1311677409gen1.jpg");
  $byteArr1 = str_split($data1);
  foreach ($byteArr1 as $key=&gt;$val) 
   { 
    $byteArr1[$key] = ord($val); 
   }
</code></pre>

<p>and send this array name to web service.but i got error parameter is not valid.i googled it.but dont get proper solution.i need it urgent.help.</p>

<p>Thanks in advance.</p>
