I try to follow this sample in PHP https://msdn.microsoft.com/library/windows/apps/xaml/hh868252.aspx
What will be the equivalent of this peace of code in PHP?
byte[] contentInBytes = Encoding.UTF8.GetBytes(xml);
...
using (Stream requestStream = request.GetRequestStream())
requestStream.Write(contentInBytes, 0, contentInBytes.Length);
If i try this, this is not working
$sendPush = curl_init();
curl_setopt($sendPush, CURLOPT_URL, $uri);
curl_setopt($sendPush, CURLOPT_HEADER, true);
$headers = array('Content-Type: text/xml',"Content-Type: text/xml","X-WNS-RequestForStatus:true", "X-WNS-Type:wns/toast","Content-Length: " . strlen($toastMessage) ,"X-WindowsPhone-Target: toast","Authorization: Bearer $accessToken");
curl_setopt($sendPush, CURLOPT_HTTPHEADER, $headers);
curl_setopt($sendPush, CURLOPT_RETURNTRANSFER, true);
curl_setopt($sendPush,CURLOPT_POST, true);
curl_setopt($sendPush, CURLOPT_POSTFIELDS, $toastMessage);
$output = curl_exec($sendPush);
Thanks for your help