Hi,

Wednesday, August 21, 2002, 11:22:36 PM, you wrote:
JJ> I want to find a certain text in a string and i want it to return me a
JJ> boolean.
JJ> What is the best thing to do this?

JJ> a) ereg("search for this", $string);                            // returns
JJ> int(1) if true, bool(false) if not
b) strpos($nav->>userAgent, "search for this") > 0    // gives me a boolean
JJ> directly

JJ> Any tips of which one I should use?

JJ> /José Jeria

you can do

if(eregi("search for this", $string)) echo 'found';




-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to