PHP question, how to do this?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

PHP question, how to do this?

Post by Davy »

Hey!

I thought there are enough programmers/coders here, and maybe one of you can tell me how to do the following.

I'm creating some new stuff for my s9y, but I haven't learnt the PHP Manual by heart. :) I also can't find what I'm looking for on PHP.net. I want to search a variable (like $field1) for an expression (like "word"). After that the script should do something depending on the search results. The last isn't a problem, but how to search variables for text?

Anyone who can help?
Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PHP question, how to do this?

Post by garvinhicking »

Hi!

Two functions will come in handy:

http://www.php.net/stristr
http://www.php.net/preg_match

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Davy
Regular
Posts: 109
Joined: Fri Oct 13, 2006 2:06 pm
Location: The Netherlands

Re: PHP question, how to do this?

Post by Davy »

garvinhicking wrote:Hi!

Two functions will come in handy:

http://www.php.net/stristr
http://www.php.net/preg_match

HTH,
Garvin
Going to look for that, thanks!
Post Reply