Mailinglisten-Archive |
Jens Spaeth wrote:
> Damit ist diese Information
> voellig wertlos, denn eine Rückumwandlung mittels Funktion ist unmoeglich - man
> denke nur an den Index "0012"...
> Ich brauche die Indeces aber!
http://www.php.net/manual/language.types.type-juggling.php3
kk_(at)_poe ~ $ /home/www/servers/kris.shonline.de/cgi/php
<?php
$str = "0012";
print gettype($str)."\n";
Content-type: text/html
string
$num = $str + 0;
print gettype($num)."\n";
integer
$morenum = (integer) $str;
print gettype($morenum)."\n";
integer
printf("str = %s num = %s morenum = %s\n", $str, $num, $morenum);
str = 0012 num = 12 morenum = 12
--
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.shonline.de/ (GPL)
php::bar PHP Wiki - Listenarchive