// [ { "id": "715320" ,"t" : "500268" ,"e" : "BOM" ,"l" : "15.55" ,"l_cur" : "Rs.15.55"
,"ltt":"3:59PM IST" ,"lt" : "Sep 9, 3:59PM IST" ,"c" : "+1.69" ,"cp" : "12.19"
,"ccol" : "chg" } ]
I need to Get each with name and assign the value to each
Like
$id=715320;
$e=BOM;
from above data, how can i do that?
Your string totally looks like a JSon data. You should use the JSon methods to parse the content.
If your really want to use regexes you can do this :
Code on ideone
Is used an array instead of variables in this code, but if you do really want to use variables such as
$ewhich is a really really bad idea, you can use variable variables.You replace the foreach content by this :
${$match[1]} = $match[2];Resources :
On the same topic :