I know this title is rather confusing, but here it goes.
I have a PHP cURL request and the return is in a string. Normally i can easily echo specific objects from the JSON response, but i have never dealt with string returns.
Here is my php
<?php
$url = "http://profile.combatarms.nexon.net/en/api/ProfilePlayerV2/OG_KneeGro__";
$ch = curl_init($url);
$headr = array();
$headr[] = "Host: profile.combatarms.nexon.net";
$headr[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0";
$headr[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
$headr[] = "Accept-Language: en-US,en;q=0.5";
$headr[] = "Cookie: i18next=en; _ls_bid=__new__; device_id=a2b3c270-bb08-4afd-8839-4c794e71dded; fingerprintv1=655870065693bdf4ced7825e4fee1f7c4e7f8a37; ccc=US";
$headr[] = "Connection: keep-alive";
$headr[] = "Upgrade-Insecure-Requests: 1";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
echo "<pre>";
echo var_dump($res);
echo "</pre>";
curl_close($ch);
?>
which return this:
string(5283) "executeParce({"d":{"nickname":"xxxxxxx","userstatus":"ACTIVE","createdate":"05/07/2013","nationcode":"US","gradelevel":"55","charactergender":"2","totrank":"5,606",alot more data,}});"
since this is not a JSON return, how do i get the nickname?
Here is the request header and response header from firefox.
Response:
Cache-Control "private"
Content-Type "application/x-javascript; charset=utf-8"
Server "Microsoft-IIS/7.5"
X-AspNetMvc-Version "5.2"
X-AspNet-Version "4.0.30319"
Set-Cookie "pageLan=1nDyHvJz5W8=; domain=…n; domain=.nexon.net; path=/"
x-powered-by "ASP.NET"
Date "Sun, 06 Aug 2017 05:50:51 GMT"
Content-Length "5283"
Request:
Host "profile.combatarms.nexon.net"
User-Agent "Mozilla/5.0 (Windows NT 10.0;… Gecko/20100101 Firefox/54.0"
Accept "text/html,application/xhtml+x…lication/xml;q=0.9,*/*;q=0.8"
Accept-Language "en-US,en;q=0.5"
Accept-Encoding "gzip, deflate"
Cookie "i18next=en; _ls_bid=__new__; …825e4fee1f7c4e7f8a37; ccc=US"
DNT "1"
Connection "keep-alive"
Upgrade-Insecure-Requests "1"
Cache-Control "max-age=0"