<?php $string = "hello %this is text% hi"; $q1 = strpos($string, "%") + 1; $q2 = strripos($string, "%"); echo mb_substr($string, $q1,$q2-$q1); ?>
it takes the string in between the %% and ignores everything else :)
<?php $string = "hello %this is text% hi"; $q1 = strpos($string, "%") + 1; $q2 = strripos($string, "%"); echo mb_substr($string, $q1,$q2-$q1); ?>
|
|
|
0 members, 1 guests, 0 anonymous users