<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: string code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 05:10:17 GMT</pubDate>
    <description>DZone Snippets: string code</description>
    <item>
      <title>Convert string to underscore_name</title>
      <link>http://snippets.dzone.com/posts/show/2681</link>
      <description>Converts "My House" to "my_house".&lt;br /&gt;Converts " Peter's nice car " to "peters_nice_car".&lt;br /&gt;Converts "_88" to "88"&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function string_to_underscore_name($string)&lt;br /&gt;{&lt;br /&gt;    $string = preg_replace('/[\'"]/', '', $string);&lt;br /&gt;    $string = preg_replace('/[^a-zA-Z0-9]+/', '_', $string);&lt;br /&gt;    $string = trim($string, '_');&lt;br /&gt;    $string = strtolower($string);&lt;br /&gt;    &lt;br /&gt;    return $string;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sat, 23 Sep 2006 17:52:55 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2681</guid>
      <author>stancell (Algimantas Stancelis)</author>
    </item>
    <item>
      <title>Check whether string begins with given string</title>
      <link>http://snippets.dzone.com/posts/show/2644</link>
      <description>Checks whether $string begins with $search&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function string_begins_with($string, $search)&lt;br /&gt;{&lt;br /&gt;    return (strncmp($string, $search, strlen($search)) == 0);&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 22 Sep 2006 15:19:46 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2644</guid>
      <author>stancell (Algimantas Stancelis)</author>
    </item>
  </channel>
</rss>
