![]() |
LIKE function in PHP?
Hi
I'm trying to compare two var's. In mySQL, I can do WHERE field1 LIKE %foo% How can I do something similiar in PHP, to exchange this: if ($field1 == $foo) { } ? (hope that's understandable :ermm: ) |
You could use Regex.
For example PHP Code:
Is that what you mean? |
You want to see if there's a substring with a string right?
E.g. if the word abracadabra contains the string cada ? |
hmmm... now that you say it like that, actually... yes...
of course, stristr() Thanks for giving me that kick I needed ;) |
You're much better off using the strpos function :) It's a lot faster!
|
All times are GMT. The time now is 03:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|