PHP String Crop
Useful little function that finds and returns a chunk of a string between point A and point B..
function crop( $d='', $b='', $e='' )
{        return substr( $d, strpos( $d, $b )+strlen( $b ), strpos( $d, $e, strpos( $d, $b ) )-strpos( $d, $b )-strlen( $b ) );
}
 
$str = "some random STRING with some html in it.";
 
echo crop( $str, '', '' );
  
 
// should output "html"
 
 
Comments
Post a Comment
Thanks
Warm regards,
Karthikeyan.T
tkarthikeyan@gmail.com
www.carthworks.com
Call us 09445 2772 06