0
votes

i want to get return values in php $variables

what i get now is like this

ok true 10007.20 cd3f2d61-c929-4a6e-a587-33878fb2b836 200

while i want to get it in variable:

  • $value1 = 'ok';
  • $value2 = 'true';
  • $value3 = '10007.20';

    $ch = curl_init();
    
    curl_setopt($ch, CURLOPT_URL,"https://www.smsbox.com/SMSGateway/Services/Messaging.asmx/Http_SendSMS");
    
    curl_setopt($ch, CURLOPT_POST, 1);
    
    curl_setopt($ch, CURLOPT_POSTFIELDS,"username=".$username."&password=".$password."&customerId=".$cutomerId."&senderText=".$senderText."&messageBody=".$messageBody."&recipientNumbers=".$recipientNumbers."&defdate=&isBlink=false&isFlash=false");
    
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $content = curl_exec($ch);
    echo $content;
    
    curl_close ($ch); 
    

echo htmlentities($content);

ok true 10005.20 4ce81f05-31cb-40c4-93e2-fd68bf50fc23 version="1.0" encoding="utf-8"?> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://itbsms.com/"> ok true 10006.20 3320429f-59b8-47fc-a49e-3e209a472b16 />

1

1 Answers

0
votes

Use explode to get the values in an array:

$values = explode(' ', $content);