-1
I’m using the remote file_get_contents
because I want to take information from a website and paste that information into my page.
Can someone help me implement the code so I can get this information?
// Endereço do site
$url = 'https://api.micetigri.fr/player/Leow%239880';
// Pegando dados do Site e colocando em uma String
$dadosSite = file_get_contents($url);
// Exibindo o retorno
echo $dadosSite;
Well he does print, only I do not know how to get the information I want below:
I just wanted to play this result on my website.
Good friend, thank you for your strength! your code helped in parts, like I have another question.How do I implode a complete table in this code ex: <table class="table table-bordered table-Hover table-Striped"> FULL TABLE</table>
– LeoS
This can vary a lot according to the table structure, but for an overall solution, you could make a loop. I created an array with all the id’s of the values you want to capture and store the data acquired with preg_match() in another array at each loop iteration.
– Edgar
I’ll try here buddy, thanks for the help!
– LeoS
I almost forget, there is also the function preg_match_all() that can be used for you, take a look http://php.net/manual/en/function.preg-match-all.php, it will return all values that contain the expression.
– Edgar