par
Guignard » 09 oct. 2014, 13:14
Bonjour,
Voila mon soucis, je suis sous wordpress et j'aimerai selectionner les deux premiers character de ma chaine issue de $post_custom[min] et les afficher plutot que d'afficher toute la chaine.
J'utilise la fonction substr mais cependant ca ne fonctionne pas.
Pouvez vous m'aider
$post_custom['min'] = substr("min", 0, 2)
if( isset($post_custom['min']) || isset($post_custom['max']) ){
$style = '';
if( isset($post_custom['min']) && isset($post_custom['max']) )
$style = ' style="font-size:10px !important"';
echo '<h4'.$style.'>';
if( isset($post_custom['min']) ){
foreach($post_custom['min'] as $key => $val){
echo $val;
}
}
if( isset($post_custom['max']) ){
echo '<br />';
foreach($post_custom['max'] as $key => $val){
echo $val;
}
}
echo '</h4>';
}
Merci
Bonjour,
Voila mon soucis, je suis sous wordpress et j'aimerai selectionner les deux premiers character de ma chaine issue de $post_custom[min] et les afficher plutot que d'afficher toute la chaine.
J'utilise la fonction substr mais cependant ca ne fonctionne pas.
Pouvez vous m'aider
[php]
$post_custom['min'] = substr("min", 0, 2)
if( isset($post_custom['min']) || isset($post_custom['max']) ){
$style = '';
if( isset($post_custom['min']) && isset($post_custom['max']) )
$style = ' style="font-size:10px !important"';
echo '<h4'.$style.'>';
if( isset($post_custom['min']) ){
foreach($post_custom['min'] as $key => $val){
echo $val;
}
}
if( isset($post_custom['max']) ){
echo '<br />';
foreach($post_custom['max'] as $key => $val){
echo $val;
}
}
echo '</h4>';
}
[/php]
Merci