I’m trying to use the jquery plugin Timeago.
With this, I want to countdown from a date (2013/03/04 format) Which is in a custom field.
Echo $Begin2 gives me something like : 34 days ago. It’s work fine.
The problem is I want to take the number “34” as a numerical value. With the following code, echo $Nombre
gives me “0”. I think it’s because get_post_meta($post->ID, 'Begin', true);
is not a numerical value ?
$Begin = get_post_meta($post->ID, 'Begin', true);
$Begin2 = '<abbr class="timeago" title="'.$Begin.'">'.$Begin.'</abbr>';
echo $Begin2;
$Nombre = (int) substr($Begin, 0, strpos($Begin, ' '));
echo $Nombre;
1 comment