title: passing argument from bash file to php (long string with spaces)
body: <p>I want to pass a text as a argument from a bash file to a php script like this:</p>
  
  <p><strong>bash script</strong></p>
  
  <pre><code>#!/bin/sh
  
  php /var/www/html/assets/sms/get_sms.php $SMS_1_NUMBER $SMS_1_TEXT
  </code></pre>
  
  <p><strong>php script</strong></p>
  
  <pre><code>&lt;?php
  
  $url = "http://localhost/user/user/get_sms/".$argv[1];    
  $postdata = array('number' =&gt; $argv[1],'text'=&gt;$argv[2]);
  do_post_request($url,$postdata);
  
  function do_post_request($url, $postdata)
  {
    //My function
  }
  ?&gt;
  </code></pre>
  
  <p>The problem is that, the first argument to the bash file is a number but the second argument is text.  The Php file which receives the arguments just takes the first string of the text. For example, if the text of the $SMS_1_TEXT variable is "How can I make it work" , the php file will receive only "How".</p>
  
  <p>How can I make it woks better?</p>
  
  <p>Thank you very much</p>