/ Published in: PHP
Returns the contents of a string between two unique strings. Useful for returning the portion of a string found between two tags such as and
Expand |
Embed | Plain Text
// String to extract string from. $string = 'This is a string to extract <tag>contents between tags</tag> from.'; // Call the function. // Function that returns the string between two strings. function extractString($string, $start, $end) { $string = " ".$string; if ($ini == 0) return ""; } // Value Echoed: contents between tags
You need to login to post a comment.
