Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $content = 'Lorem Ipsum is simply dummy text <remove this part and all content after first <';
- $content = substr($content, 0, strpos($content, "<"));
- // will display: Lorem Ipsum is simply dummy text
- print_r($content);
- // another example we need only output after specified word
- $content = 'Lorem Ipsum is simply dummy text remove this part and all content after "remove" word';
- $content = substr($content, 0, strpos($content, "remove"));
- // will display: Lorem Ipsum is simply dummy text
- print_r($content);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement