SMS Api URL in PHP doesnt work if there is space in msg

From angular i am trying to hit PHP api URL to send SMS Everything works fine if there is no space is the message, but if i add a space i am not receiving any messages. Below is my php code:: <?php header(‘Access-Control-Allow-Headers:Content-Type,x-prototype-version,x-requested-with’); header(‘Cache-Control:max-age=900’); include_once(“conn.php”); $phno=$_POST[‘phno’]; $msg=$_POST[‘msg’]; $final = array(); $msg=’Thank you.’; sms($phno,$msg); $final[‘status’]=’success’; $final[‘message’]=”Success”;…

Details