Posted By

ishkur on 07/22/08


Tagged

php find substring


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jamesming


substring_between


 / Published in: PHP
 

  1. function substring_between($haystack,$start,$end) {
  2. $start_position = strpos($haystack,$start)+strlen($start);
  3. $end_position = strpos($haystack,$end);
  4. return substr($haystack,$start_position,$end_position-$start_position);
  5. }

Report this snippet  

You need to login to post a comment.