The Arcive of vBulletin Modifications Site. |
|
|
#1
|
||||
|
||||
|
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: ) |
|
#2
|
|||
|
|||
|
You could use Regex.
For example PHP Code:
Is that what you mean? |
|
#3
|
||||
|
||||
|
You want to see if there's a substring with a string right?
E.g. if the word abracadabra contains the string cada ? |
|
#4
|
||||
|
||||
|
hmmm... now that you say it like that, actually... yes...
of course, stristr() Thanks for giving me that kick I needed
|
|
#5
|
||||
|
||||
|
You're much better off using the strpos function
It's a lot faster!
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|