Hello everyone, I have the following data:

LI_site = 'idwm.biz'; LI_month_hit = 338632; LI_month_vis = 11129; LI_week_hit = 73786; LI_week_vis = 3518; LI_day_hit = 10028; LI_day_vis = 750; LI_today_hit = 9516; LI_today_vis = 730; LI_online_hit = 168; LI_online_vis = 20; 

It is necessary with the help of php to push all the values ​​(everything after = and before;) into the array, and so that you can later write like this:

 echo $somevariable[1]; 

And the value 338632 was derived, I just can not solve this problem, please help (

  • This data is stored where you? In file? - Opalosolo
  • On the Internet address: counter.yadro.ru/values?site=idwm.biz - Angus123
  • from the first index? $ variable ['LI_month_hit'] not suitable? - zb '
  • one
    Only for the purpose of laughing: print_r(json_decode('{"' .str_replace(array("\r", "\n", ';', ' = ', "'"), array('', '', '", "', '" : "', ""), trim(trim(file_get_contents('http://counter.yadro.ru/values?site=idwm.biz')), ';')) . '"}')); ;-) - Indifferent
  • one
    To laugh even harder: ideone.com/mA4UGm - ReinRaus

1 answer 1

 $url = 'http://counter.yadro.ru/values?site=idwm.biz'; if($data = file_get_contents($url)) $result = parse_ini_string($data); echo '<pre>'.print_r($result, true).'</pre>'; 
  • Thank you very much, this option came up, and even easy without regular expressions :) - Angus123