Hello, good afternoon. How can I make a foreach loop or a preg_match_all to count how much the appid element repeats on a page?
I tried and this way:
function get_Jogos() {
$array = [ ["appid" => 291550,"name" => "Brawlhalla"], ["appid" => 000000,"name" => "Teste"], ["appid" => 000023,"name" => "Teste2"], ];
foreach($array as $arr)
if (array_key_exists("appid", $arr))
echo $jogos = $arr["name"] . "<br>";
}
get_Jogos();
New question:
How to check for the "appid" string on a page after a cURL and thus make the listing of the names of the "games"?
curl_setopt($ch, CURLOPT_URL , "https://steamcommunity.com/profiles/$steamid/games/?tab=all");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$resp = curl_exec($ch);