How to recover the data of a page [closed]

-3

Good afternoon, could anyone help me on how I could retrieve data from this page with php? www.boline.com.br/teste.php

I know that I need to use regular expressions in order to separate the data, but I do not know how to do it.

    
asked by anonymous 04.02.2016 / 20:54

1 answer

1

Do not necessarily need regex for this, you can go doing exploits and getting the data.

For example, you can get all data separated by space:

 $dados = explode("\n", file_get_contents('www.boline.com.br/teste.php'));

You can go iterating this result and make new exploits;)

With regex:

preg_match_all('~([0-9]{4})=([0-9]{2}),([0-9]{2}),([0-9]{2}),([0-9]{2}),([0-9]{2}),([0-9]{2})~', file_get_contents('www.boline.com.br/teste.php'), $dados);

There you will have:

0001=41,05,04,52,30,33

$dados[1][0] = 0001
$dados[1][1] = 41
$dados[1][2] = 05
$dados[1][3] = 04
$dados[1][4] = 52
$dados[1][5] = 30
$dados[1][6] = 33
    
04.02.2016 / 21:09