8797 sujets

Développement web côté serveur, CMS

Hello; j'ai une fonction qui me fait un truc très, très bizarre.
Et surtout, très, très, très énervant :

ça, ça marche :
$img = g2_tagimageblock('396|100'); //--->fonctionne
return $img;


ça, ça marche pas

$tag = $wpg2tag[0].'|'.$thumbsize;
echo $tag; //rend : 396|100
$img = g2_tagimageblock($tag); // ----> fonctionne pas ????!
return $img;
$img = g2_tagimageblock('396|100'); //--->fonctionne
return $img;


A priori je pencherai peut-être pour la barre verticale de pipe | qui dans le premier cas fait partie d'une chaîne de caractère (ton '396|100')...


$tag = $wpg2tag[0].'|'.$thumbsize;
echo $tag; //rend : 396|100
$img = g2_tagimageblock($tag); // ----> fonctionne pas ????!
return $img;


...alors que dans le second cas l'interpréteur php doit comprendre que c'est un "ou bit-à-bit : opérateur | " malgré le .'|'. qui devrait en faire une chaîne de caractère ?? Que donne un var_dump et/ou un print_r de $tag ?? Bizarre qd même...