in php i want to explode string with tag using utf-8 between them, for example, in this text:
$content = \"فهرست اول hi my name is
You can try the following function, it should meet your needs well. Basically you should split the array using
as the delimiter, and each item in the resultant array will be what you require, but the heading tag will be stripped since it is what you did your split on, so you need to add it back. There are comments explaining what the code is doing.
function get_what_mahdi_wants($in_string){
$mahdis_strings_array = array();
// Split string at occurrences of ''
$mahdis_strings = explode('', $in_string);
foreach($mahdis_strings as $mahdis_string){
// if '' is found at start of string, empty array element will be created. Skip it.
if($mahdis_string == ''){ continue; }
// Add back string element with '' tag prepended since exploding on it stripped it.
$mahdis_strings_array[] = ''.$mahdis_string;
}
return $mahdis_strings_array;
}