<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: PHP - parse a string between two strings</title>
	<atom:link href="http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/</link>
	<description>A web, technology, programming and SEO blog by Justin Cook</description>
	<pubDate>Sun, 07 Sep 2008 22:06:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: akum</title>
		<link>http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-134898</link>
		<dc:creator>akum</dc:creator>
		<pubDate>Thu, 17 Jul 2008 15:53:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-134898</guid>
		<description>super .) this is exactly what i need. thanks</description>
		<content:encoded><![CDATA[<p>super .) this is exactly what i need. thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane10101</title>
		<link>http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-106861</link>
		<dc:creator>Shane10101</dc:creator>
		<pubDate>Sat, 07 Jun 2008 16:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-106861</guid>
		<description>I haven't tried this yet, but it looks like this function wouldn't work if $start appears at the very beginning of $string:  strpos($string,$start) would return "0", which would make the function react as though strpos($string,$start) were "false" (ie, boolean 0), &#38; thus the function would return "".  

Perhaps using the === operator would solve this:  

if ($ini === 0) return ""; would be evaluated as false if strpos($string,$start) returned "0" (as in "position zero"), but evaluated as "true" if strpos($string,$start) returned false (ie, boolean zero).  

Does this make sense?  (I'll need to give it a try to know for sure.)

I hope this helps.

Shane1010</description>
		<content:encoded><![CDATA[<p>I haven&#039;t tried this yet, but it looks like this function wouldn&#039;t work if $start appears at the very beginning of $string:  strpos($string,$start) would return &#034;0&#034;, which would make the function react as though strpos($string,$start) were &#034;false&#034; (ie, boolean 0), &amp; thus the function would return &#034;&#034;.  </p>
<p>Perhaps using the === operator would solve this:  </p>
<p>if ($ini === 0) return &#034;&#034;; would be evaluated as false if strpos($string,$start) returned &#034;0&#034; (as in &#034;position zero&#034;), but evaluated as &#034;true&#034; if strpos($string,$start) returned false (ie, boolean zero).  </p>
<p>Does this make sense?  (I&#039;ll need to give it a try to know for sure.)</p>
<p>I hope this helps.</p>
<p>Shane1010</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sidsevensix</title>
		<link>http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-47770</link>
		<dc:creator>sidsevensix</dc:creator>
		<pubDate>Sat, 10 Nov 2007 03:11:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.justin-cook.com/wp/2006/03/31/php-parse-a-string-between-two-strings/#comment-47770</guid>
		<description>whoop! tanks!</description>
		<content:encoded><![CDATA[<p>whoop! tanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.120 seconds -->
