how to search a word in a sentence, it's simple, but i dont't know, how?
$sentence = "my name is smansakra";
$word_to_search = "smansakra";
//
//
i want like this:
if $word_to_search is found on $sentence, echo "wellcome my dear";
how?![]()
how to search a word in a sentence, it's simple, but i dont't know, how?
$sentence = "my name is smansakra";
$word_to_search = "smansakra";
//
//
i want like this:
if $word_to_search is found on $sentence, echo "wellcome my dear";
how?![]()
///////////////////////////////////////////////////
///// http://www.mediatutorial.web.id
///////////////////////////////////////////////////
Code:function in_sentence($word, $sentence) { return in_array($word, explode(' ', $sentence)); }
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks