[PHP-JS] La fonction intval() me renvoie toujours 0
Bonjour, après 48h de recherche sur le web, je n'ai pas trouvé la solution à mon problème, a savoir, transformer une chaine en integer...facile apparement mais....sir je fais ça :
Code:
1 2 3 4 5
| <?php
$str="0106";
$new=intval($str);
echo $new." ".gettype($new);
?> |
ça me renvoie bien un entier valant 106, mais sir je fais la même chose dans ma fonction; a savoir :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| function resizePic($aWidth,$aHeight,$aSupportId){
// Taille maxi
$aWidthMax="<script>document.write(document.getElementById('".$aSupportId."').style.width);</script>";
$aHeightMax="<script>document.write(document.getElementById('".$aSupportId."').style.height);</script>";
$new=intval($aWidthMax);
echo $new." ".gettype($new);
.
.
.
.
.
. }
?> |