lundi 20 avril 2015

String matching using preg_match() in PHP [duplicate]

This question already has an answer here:

I have a string something like this

$str="syx.ypzd [xys.ypd] yup";

I am trying to get the value inside [ ] .

I have a code something like this

preg_match('[xys.ypd]', $str, $Fdesc);
echo $Fdesc[1];

But this is not working

Please let me know where I am going wrong

Thanks & Regards

Aucun commentaire:

Enregistrer un commentaire