Forum : php
Brief description  about Online courses   join in Online courses
View Karm jeet singh 's Profile

php

how to Create a string, search for a word in that string. If the word is found display word found. If not found display a message saying word not found.
Asked by Karm jeet singh | Nov 19, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Karmjeet,

Check out the fallowing Example,

<?php
$string = 'Hello World!';
if(stristr($string, 'Hello') === TRUE) {
echo '"Hello" found in string';
}else{
echo '"Hello" not found in string';
}
?>
Nov 23, 2010