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
Post a Comment