- Forums
- PHP
- Find And Start From First Occurrence Of A String PHP
This Page Contains information about Find And Start From First Occurrence Of A String PHP By wallpaperama in category PHP with 1 Replies. [1044], Last Updated: Sat May 18, 2024
wallpaperama
Wed Jun 20, 2007
1 Comments
626 Visits
ok, in this tutorial, i will show you how you can diplay a string only from a certain part of the string. so lets say i have this string:
$string = "i find that wallpaperama has many beautiful wallpapers"
and i only want to show "wallpaperama has many beautiful wallpapers"
i can do this with php strstr() function by using this code
<?php
$string = "i find that wallpaperama has many beautiful wallpapers";
$newstring =strstr ($string, "wallpaperama");
echo($newstring);
?>
and this would be the output:
wallpaperama has many beautiful wallpapersbasically, what i did with this php code, i told php to remove anything before wallpaperama
hope this helps
https://www.wallpaperama.com/forums/find-and-start-from-first-occurrence-of-a-string-php-t1553.html