Ben kıvrılma ile yürütmek için bir url inşa ediyorum. url kullanıyorum LMS için bir API arayacak. Başka bir şey aramak edememek önce, url koymak için LMS bir belirteç almak gerekir. Ben API gelen belirteci aldık ve bunu yankı ve ben buna belirteci ekleyerek sonra url yankı zaman, o kadar görünmüyor, sadece iyi gösterir.
curl_setopt($c, 'CURLOPT_RETURNTRANSFER', true);
$res = curl_exec($c);
curl_close($c);
$start = strpos($res,"<token>");
$end = $start+37;
$token = substr($res,$start+7,$end-$start);
echo "{$token}<br />";
$url = "/www/api2.php?action=create_user";
$url .= "&login=" . urlencode($username);
$url .= "&password=" . urlencode($password);
$url .= "&name=" . urlencode($data['first_name']);
$url .= "&surname=" . urlencode($data['last_name']);
$url .= "&email=" . urlencode($email);
$url .= "&languages=english";
$url .= "&token=" . $token;
echo "{$url}<br />";
echo "{$url}<br />"; Çıktı
/www/api2.php?action=create_user&login=foobar3130&password=6116b3f29c&name=Foo&surname=Bar&email=foobar%40gmail.com&languages=english&token=
echo "{$token}<br />"; Çıktı
pUCu2BUAE1heAyQ93fApfhvDE1bjKd
Edit
I added a check to see if $start was false, and it is false. I guess its not actually the token that gets echo'd because if I comment that line out, the string that I have for the token output still gets printed. I'm not sure what it would even be from.
Edit 2 I now have it returning xml but I am not sure how to parse it to get the token. It returns:
<xml><token>Fp1rYkds4fSuTAQxTvLvSiW5NE2FJz</token></xml>