php - Getting HTML before first <br/> tag -
i've been trying extract content of variable before first break tag occurs in php.
e.g
$content = "this content <br /> continues <br /> break tag";
i want part before first
tag , store in variable $first. above example, $first should contain "this content"
any idea how in php? i'm stuck split() php function...
$content = "this content <br /> continues <br /> break tag"; $parts = explode("<br />", $content); $first = trim($parts[0]);
explode function: http://php.net/manual/en/function.explode.php
split string string
trim function: http://www.php.net/manual/en/function.trim.php
strip whitespace beginning , end of string
Comments
Post a Comment