substr not working? php
<p>Unfortunately I can't point you to a live example. But I've got a form that submits a bunch of data to the database.</p>

<p>I retrieve the 'date' field with </p>

<pre><code>genesis_custom_field('date')
</code></pre>

<p>and the output date is "mm/dd/yyyy" e.g., 02/19/2012</p>

<p>so shouldn't </p>

<pre><code>echo substr(genesis_custom_field('date'), 0, 2) . '&lt;-M&lt;br /&gt;'
</code></pre>

<p>output "02"</p>

<p>instead, it's outputting the full date format, "02/19/2012".</p>

<p><strong>INTENTS AND PURPOSES</strong></p>

<p>for intents and purposes, here's the code sample.</p>

<pre><code>// The Query
$reviews_query = new WP_Query('showposts=1');

// The Loop
while ( $reviews_query-&gt;have_posts() ) : $reviews_query-&gt;the_post();

echo substr(genesis_custom_field('date'), 0, 2) . '&lt;-M&lt;br /&gt;';

endwhile;
// Reset Post Data
wp_reset_postdata();
</code></pre>

<p>with the intended output of</p>

<pre><code>02&lt;-M
</code></pre>

<p>but I'm getting</p>

<pre><code>02/19/2012&lt;-M
</code></pre>
