Find And Start From First Occurrence Of A String PHP

Welcome Login | Register

Find And Start From First Occurrence Of A String PHP
  Forums Index
      » PHP Forums
        » » Find and start from first occurrence of a string PHP



Find And Start From First Occurrence Of A String PHP
Post Description:
Post Tags: find, and, start, from, first, occurrence, of, a, string, php, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 216 Times Since Wed Jun 20, 2007 8:56 am Posted By hostman with 0 replies
Next Post »» remove certain last characters from a string in php
Find And Start From First Occurrence Of A String PHP
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 wallpapers

basically, what i did with this php code, i told php to remove anything before wallpaperama

hope this helps




Leave Your Comments






Share
HTML Link:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About Find And Start From First Occurrence Of A String PHP




(0) Comments