<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP Software Developing &#187; Strings</title>
	<atom:link href="http://www.phpdeveloping.co.za/tag/strings/feed" rel="self" type="application/rss+xml" />
	<link>http://www.phpdeveloping.co.za</link>
	<description>for the love of PHP Development</description>
	<lastBuildDate>Tue, 29 Sep 2009 15:38:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Does a string begin with another string</title>
		<link>http://www.phpdeveloping.co.za/strings/does-a-string-begin-with-another-string.html</link>
		<comments>http://www.phpdeveloping.co.za/strings/does-a-string-begin-with-another-string.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:05:15 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Strings]]></category>
		<category><![CDATA[string starts with string]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=75</guid>
		<description><![CDATA[Here is a function to check if a string begings with another string

  function startsWith&#40;$haystack,$needle,$case=true&#41; &#123;
    if&#40;$case&#41;  &#123; 
      return &#40;strcmp&#40;substr&#40;$haystack, 0, strlen&#40;$needle&#41;&#41;,$needle&#41;===0&#41;;
    &#125;
    return &#40;strcmp&#40;strtolower&#40;substr&#40;$haystack, 0, strlen&#40;$needle&#41;&#41;&#41;,strtolower&#40;$needle&#41;&#41;===0&#41;;
  &#125;

]]></description>
			<content:encoded><![CDATA[<p>Here is a function to check if a string begings with another string</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">function</span> startsWith<span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span><span style="color: #000088;">$needle</span><span style="color: #339933;">,</span><span style="color: #000088;">$case</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$case</span><span style="color: #009900;">&#41;</span>  <span style="color: #009900;">&#123;</span> 
      <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/strings/does-a-string-begin-with-another-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Does a string end with another string</title>
		<link>http://www.phpdeveloping.co.za/strings/does-a-string-end-with-another-string.html</link>
		<comments>http://www.phpdeveloping.co.za/strings/does-a-string-end-with-another-string.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 16:05:13 +0000</pubDate>
		<dc:creator>chris</dc:creator>
				<category><![CDATA[Strings]]></category>
		<category><![CDATA[string ends with string]]></category>

		<guid isPermaLink="false">http://www.phpdeveloping.co.za/?p=77</guid>
		<description><![CDATA[Here&#8217;s a nice function to check if a string ends with another string:

  function endsWith&#40;$haystack,$needle,$case=true&#41; &#123;
    if&#40;$case&#41;&#123;
      return &#40;strcmp&#40;substr&#40;$haystack, strlen&#40;$haystack&#41; - strlen&#40;$needle&#41;&#41;,$needle&#41;===0&#41;;
    &#125;
    return &#40;strcmp&#40;strtolower&#40;substr&#40;$haystack, strlen&#40;$haystack&#41; - strlen&#40;$needle&#41;&#41;&#41;,strtolower&#40;$needle&#41;&#41;===0&#41;;
  &#125;

]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a nice function to check if a string ends with another string:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">function</span> endsWith<span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span><span style="color: #000088;">$needle</span><span style="color: #339933;">,</span><span style="color: #000088;">$case</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$case</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$haystack</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$needle</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">===</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpdeveloping.co.za/strings/does-a-string-end-with-another-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
