Cannot read the first letter
<p>I want to add a function to return whether the first letter is a capital or not from <a href="http://stackoverflow.com/questions/11250744/cannot-insert-sentence-to-database">my last question</a>. </p>

<p>Here's the code:</p>

<pre><code>&lt;?php

function isCapital($string) {
   return $string = preg_match('/[A-Z]$/',$string{0});
}

$text = " Poetry. do you read poetry while flying? Many people find it relaxing to read on long flights. Poetry can be divided into several genres, or categories. ";
$sentences = explode(".", $text); $save = array();
foreach ($sentences as $sentence) {
   if (count(preg_split('/\s+/', $sentence)) &gt; 6) {
      $save[] = $sentence. ".";
   }
}

if( count( $save) &gt; 0) {
   foreach ($save as $nama){
      if (isCapital($nama)){
         print_r ($nama);
      }
   }
}
?&gt;
</code></pre>

<p>The result should be...</p>

<blockquote>
  <p>Poetry can be divided into several genres, or categories.</p>
</blockquote>

<p>...but it prints nothing. I need only the sentence that consists of more than 6 words and start with capital letter.</p>
