after 10 years with php i still S*** in regex , could you please help me converting this
$x_ary=split('&x=',$url);
to the preg_split equivalent ?
Thank you
after 10 years with php i still S*** in regex , could you please help me converting this
$x_ary=split('&x=',$url);
to the preg_split equivalent ?
Thank you
In most cases you just need to add delimiters:
preg_split('/&x=/',$url)
/
are fine if you do not need them as part of the pattern. And none of the other symbols are meta characters, so don't need escaping.
Take note that in your case you could just use explode
instead, since you don't need a regex.