Selecting one word out of a phrase

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mr Tech
Forum Contributor
Posts: 424
Joined: Tue Aug 10, 2004 3:08 am

Selecting one word out of a phrase

Post by Mr Tech »

In mysql, you can do something like this:

Code: Select all

select row from table where field like '%test%'
That will select from any field that has test in it.

How do you do that in PHP. For example:

Code: Select all

if ($variable == "%test%") {
Is that possible?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

(#10850)
Post Reply