micnic Posted February 17, 2006 Share Posted February 17, 2006 J'ai une variable qui stocke un nombre mais en chaine. J'aimerai la transformer en valeur pour pouvoir la comparer (if (lavaleurdelavariable > 4)...). Quelel fonction faut utiliser ?? merci Link to comment Share on other sites More sharing options...
keneda212 Posted February 17, 2006 Share Posted February 17, 2006 quel langage de programmation ? si c'est du c , fait un sscanf(ta chaine, "%d", ta variable) Link to comment Share on other sites More sharing options...
micnic Posted February 17, 2006 Author Share Posted February 17, 2006 lol oui désolé, c du PHP. Et je crois que c'set ord( Link to comment Share on other sites More sharing options...
Sentinel Posted February 18, 2006 Share Posted February 18, 2006 PHP étant faiblement typé, il suffit d'effectuer la comparaison avec > ou <, le langage déduira que c'est une comparaison arithmétique. Link to comment Share on other sites More sharing options...
toon56 Posted February 18, 2006 Share Posted February 18, 2006 sscanf pour PHP >=4.01 Link to comment Share on other sites More sharing options...
theocrite Posted February 18, 2006 Share Posted February 18, 2006 Et la prochaine fois pense à mettre le langage dans le titre pour orienter le lecteurs, merci Et si tu n'as plus de questions aussi. Link to comment Share on other sites More sharing options...
micnic Posted April 18, 2006 Author Share Posted April 18, 2006 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.