preg split - Php preg_split for forwardslash? -


i've text wish parse

$str = "text1<br/>text2<br/>text3 

i've tried using

     print_r( preg_split("<br/>", $str)); 

but not giving me desired output

try following:

$str = "text1<br/>text2<br/>text3"; print_r(preg_split("/<br\/>/", $str)); 

i'm assuming missing closing quote " @ end of $str = "text1<br/>text2<br/>text3" typo.

take @ page on how specify string $pattern parameter: http://php.net/manual/en/function.preg-split.php


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -