Solved

how can i search a sentince in onther sentince?

Posted on 2008-10-01
2
238 Views
Last Modified: 2012-05-05
for example i have this sentince "good hall sdff " and i want to search for it in "the hall of fim is good"
and to give me true

and please i dont want it using exploade beacuse i know how to do it in exploade but it is slow
0
Comment
Question by:mgtm3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
hielo earned 350 total points
ID: 22614142
$string="the hall of fame is good";
if( FALSE !==stripos($string,"good hall fame" ) )
{
 echo "found";
}

NOTE: The above will do a case INSENSITVE comparison. If you want a case sensitive comparison use:
strpos()
0
 
LVL 3

Assisted Solution

by:smueller72
smueller72 earned 150 total points
ID: 22614171
if you don't want to hard code it in the code (you want to work on text given by an input box or similar), you need a 'fuzzy search' class such as the following:
http://elonen.iki.fi/code/misc-notes/appr-search-php/
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Inserting results of While loop to sql server 5 38
Generate PDF from MySQL using PHP 3 55
Find RGB colors from a screen. 2 19
PHP $_POST vs asp request 4 28
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question