I don't understand where friendlyURL, and how to remove it?

Hello, I downloaded 1 code from the Internet to understand how it works and decided to check it out but it's not clear where there friendlyURL, how to get rid of I don't know. Anyone can help help. I know very little PHP.
Corr
<?
///andrey69rus 

function curl($url)
{
$ch = curl_init( $url );
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_ENCODING, ""); 
 curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.14');
 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
 curl_setopt($ch, CURLOPT_TIMEOUT, 120);
 $result = curl_exec($ch); 
curl_close($ch);
 return $result;
}
#########################################
$token = 'mytoken'; // token VK api 
$steam_id = 'my steam id'; /// steam id

#########################################

$result = curl("http://steamcommunity.com/id/$steam_id/");
 preg_match('$<div class="profile_in_game_header"-->(.*?)
$si',$result ,$profile_in_game); if ($profile_in_game[1] == 'Currently In-Game') { preg_match('$<div class="profile_in_game_name">(.*?)</div>$si',$result ,$game_name); $game_time == "; $result = curl("http://steamcommunity.com/id/$steam_id/games/"); $result = preg_replace('|<!--DOCTYP(.*?)"name":"'.$game_name[1].'","last_played":(.*?),"hours":"|is', ",$result); $result = preg_replace('|","availStatLinks":(.*?)</html-->|is', ' hrs)',$result); $game_time = str_replace('","hours_forever":"',' h for the last two weeks ',$result); $text .= 'Now I'm in '.$game_name[1] .' ('.$game_time; }; if ($profile_in_game[1] == 'In non-Steam game') { preg_match('$<div class="profile_in_game_name">(.*?)</div>$si',$result ,$game_name); $text .= 'Now I'm in '.$game_name[1]; }; #################### status through vk api echo $text.'<br>'; $sRequest = "https://api.vk.com/method/status.set?text=".urlencode($text)."&access_token=".$token; $statusSet = curl($sRequest); $result = json_decode($statusSet,1); if ($result['response'] == '1'){ echo 'Test'; }else{ echo 'ERROR: '.$result['error']['error_msg']; } ?>
June 10th 19 at 15:21
1 answer
June 10th 19 at 15:23
Solution
It is taken from the source code page, the address of which steamcommunity.com/id/<your steam id>/games
downstairs there is a js object with these data. The regular season is not written correctly and cut the excess
How to get rid of? - mattie_Friese commented on June 10th 19 at 15:26
to understand how does this code and correct it. Either rewrite. Your cap - Mabelle.Gerhold86 commented on June 10th 19 at 15:29
All the code to rewrite? - mattie_Friese commented on June 10th 19 at 15:32
I would rewrite the whole, and you only need to understand what is happening here
$result = preg_replace('|<!--DOCTYP(.*?)"name":"'.$game_name[1].'","last_played":(.*?),"hours":"|is', ",$result);
$result = preg_replace('|","availStatLinks":(.*?)</html-->|is', ' hrs)',$result);
$game_time = str_replace('","hours_forever":"',' h for the last two weeks ',$result);

and correct - Mabelle.Gerhold86 commented on June 10th 19 at 15:35
, How to correct, so what? I am new to PHP. - mattie_Friese commented on June 10th 19 at 15:38
to read the documentation, what does the function, to think, to rule. For you anybody will not write, alas. - Mabelle.Gerhold86 commented on June 10th 19 at 15:41
Yes I have corrected. - mattie_Friese commented on June 10th 19 at 15:44

Find more questions by tags PHP