string function

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
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

string function

Post by itsmani1 »

Hi

i have two strings:

a="Hello its me here."
b="me"

now i want to check if b is in a or not?
now in this case b is in a
how can i check this?

thanks.
User avatar
Oren
DevNet Resident
Posts: 1640
Joined: Fri Apr 07, 2006 5:13 am
Location: Israel

Post by Oren »

User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Code: Select all

<?php
$mystring = 'abc';
$findme   = 'a';
if (strpos($mystring, $findme) !== false)
{
  echo 'Yahoo';
}
?>
Post Reply