mercredi 1 avril 2015

Get Value from string between ":" and ","

Here is example of my string



"{"id":128,"order":128,"active":"1","name":"\"


Now I need to get "128" - id parameter. So its first value between ":" and ",".


I have tried with preg_match and different regular expressions but I'm just not good in regular expressions. Maybe someone will knew how to make it ?



$id = preg_match('/:(,*?)\,/s', $content, $matches);

Aucun commentaire:

Enregistrer un commentaire