title: How to Ignore Letters After Numbers In An Array
body: <p>I am currently using this code to display the final child in a hierarchical taxonomy.  For example, a post tagged 20th Century > 1990s > 1994 should ultimately only show 1994.  </p>
  
  <p>The code below works for most Parent/Child groups except for ones that end with 0s and have a child of 0.  For example, 20th Century > 1990s > 1990 outputs 1990s (and not 1990).  </p>
  
  <p>I think the problem is that array() is using an alphanumerical method that outputs 20xxxx, 1990, 1990x.  Thus thinking the final child is 1990s (not 1990). </p>
  
  <p>Is there a way to ignore letters in an array?  Or is there a better order to use than array()?</p>
  
  <pre><code>  &lt;?php
  
      $terms = get_the_terms( $post-&gt;ID, 'From' );
  
          if ( !empty( $terms ) ) {
              $output = array();
              foreach ( $terms as $term ){
                  if( 0 != $term-&gt;parent )
                      $output[] = '&lt;a href="' . get_term_link( $term ) .'"&gt;' . $term-&gt;name . '&lt;/a&gt;';
              }
  
                  if( count( $output ) )
                  echo '&lt;p&gt;&lt;b&gt;' . __('','From') . '&lt;/b&gt; ' . end($output) . '&lt;/p&gt;';
              }
      ?&gt;
  </code></pre>
  
  <p>If you need, you can also preview my site here: dev.jamesoclaire.com The first post shows "2010s" when instead it should show "2010"</p>