View Single Post
Old Apr 25th, 2006, 5:30 AM   #1
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 4 ktsirig is on a distinguished road
match entire string in PHP

Hi all!
What I want to ask might be rather silly, but I have come across it a couple of days now and don't seem to find any solution.
Consider the following variables :

$var1= "ps :Hello and welcome to greece";
$var2= "ps :Hello and";
$var3= "ps :It was nice to meeting you";

My problem is that, when I check $var2, it matches both $var1 and $var3, because , as you can see, $var3 has "ps" in it.
So, I was wondering if there is a way of matching ENTIRE $var2 and not just portions of it. In this way, it would match only $var1 and not $var3...
ktsirig is offline   Reply With Quote