Posted By

o0110o on 10/21/12


Tagged

php String text explode


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

o0110o


Get the text in between more text in a string.


 / Published in: PHP
 

Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.

  1. function txt_between($content,$start,$end,$is_string=null){
  2. if (!$is_string) { $string = file_content($content); } // Is it a string or a file
  3. $output = explode($start, $string);
  4. if (isset($output[1])){
  5. $r = explode($end, $output[1]);
  6. return $output[0];
  7. }
  8. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Mccauleyray on February 14, 2019

Thanks for sharing this code it helps me a lot. Router Login

Posted By: peterpark on August 20, 2019

192.168.l00.1 nice one good post

Posted By: peterpark on August 20, 2019

192.168.ll

192.168.0.1.1

sounddownmp3.com nice one good post

Posted By: peterpark on October 2, 2019

192.168.0.1

192.168.1.1

192.168.l.254 Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now,

You need to login to post a comment.