<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1034146" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1034146</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/match-entire-string-php#comment-1199006</link>
    <description> &lt;p&gt;CptAwesome, your suggestion would work if the strings were the same length, from the post, he wants &lt;strong&gt;$var2&lt;/strong&gt; (&lt;em&gt;ps :Hello and&lt;/em&gt;) to match against &lt;strong&gt;$var1&lt;/strong&gt; (&lt;em&gt;ps :Hello and welcome to greece&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt; A direct &lt;strong&gt;if ($var2 == $var1)&lt;/strong&gt; would return false. he would have to do something like:&lt;/p&gt;
&lt;p&gt; &lt;strong&gt;if ($var2 == substr($var1,0,strlen($var2)))&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For the strcmp, I wasn&#039;t sure, so I did a test:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;v1 vs v2 results in: &#039; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;. &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;strcmp&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;).\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;\n\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; echo &#039;v3 vs v2 results in: &#039; . strcmp(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var3&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;).\&quot;\n\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; echo &#039;v2 vs v1 results in: &#039; . strcmp(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;).\&quot;\n\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; echo &#039;v2 vs v3 results in: &#039; . strcmp(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var3&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;).\&quot;\n\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
gave me this: &lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: v1 vs v2 results in: 18&lt;br /&gt;
v3 vs v2 results in: 1&lt;br /&gt;
v2 vs v1 results in: -18&lt;br /&gt;
v2 vs v3 results in: -1&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;So looks like that won&#039;t work as both var1 and var3 give the same type fo results (either &amp;gt; 0 or &amp;lt; 0 depending on order give)&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 May 2006 09:52:30 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1199006 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/match-entire-string-php#comment-1198980</link>
    <description> &lt;p&gt;Try the strcmp function. That&#039;s your best bet.&lt;/p&gt;
&lt;p&gt;strcmp&lt;br /&gt;
(PHP 3, PHP 4, PHP 5)&lt;/p&gt;
&lt;p&gt;strcmp -- Binary safe string comparison&lt;br /&gt;
Description&lt;br /&gt;
int strcmp ( string str1, string str2 )&lt;/p&gt;
&lt;p&gt;Returns &amp;lt; 0 if str1 is less than str2; &amp;gt; 0 if str1 is greater than str2, and 0 if they are equal. &lt;/p&gt;
&lt;p&gt;Note that this comparison is case sensitive.&lt;/p&gt;
 </description>
     <pubDate>Thu, 04 May 2006 19:57:04 +0000</pubDate>
 <dc:creator>ablaye</dc:creator>
 <guid isPermaLink="false">comment 1198980 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/match-entire-string-php#comment-1198968</link>
    <description> &lt;p&gt;Well, what are you using for matching? ereg? why not do:&lt;br /&gt;
if($str == $var1)&lt;/p&gt;
&lt;p&gt;== is an exact match...&lt;br /&gt;
=== is an exact match and type match&lt;/p&gt;
 </description>
     <pubDate>Thu, 04 May 2006 16:33:52 +0000</pubDate>
 <dc:creator>CptAwesome</dc:creator>
 <guid isPermaLink="false">comment 1198968 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/match-entire-string-php#comment-1198390</link>
    <description> &lt;p&gt;What are you currently using to compare the strings?&lt;/p&gt;
&lt;p&gt;Try &lt;strong&gt;strpos()&lt;/strong&gt; (see &lt;a href=&quot;http://www.php.net/strpos&quot; class=&quot;bb-url&quot;&gt;http://www.php.net/strpos&lt;/a&gt; for more details)&lt;/p&gt;
&lt;p&gt;This worked for me:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$var1&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;ps :Hello and welcome to greece\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;= \&quot;ps :Hello and\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var3&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;= \&quot;ps :It was nice to meeting you\&quot;;&lt;br /&gt;&lt;br /&gt;if (strpos(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var1&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)===false)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot;Not Found in Var1 \n\&quot;;&lt;br /&gt;else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot;Was Found in Var1 \n\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;if (strpos(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var3&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$var2&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)===false)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot;Not Found in Var3 \n\&quot;;&lt;br /&gt;else &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo \&quot;Was Found in Var3 \n\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Wed, 26 Apr 2006 08:36:26 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1198390 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
