note 58140 added to function.settype
| From: | php-general at lists dot php dot net | Date: | Tue, 25 Oct 2005 13:30:02 +0000 |
| Subject: | note 58140 added to function.settype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-97574@lists.php.net to get a copy of this message | ||
James Reiher (IL) writes:
23-Feb-2005 06:50
$agentnum = "007";
$agentnum = settype($agentnum, "int");
echo $agentnum; // will show up as 1 instead of 7!
James, the return value of settype function is boolean, 1 if succsess.
Correct code: $success=settype($agentnum, "int");
The $agentnum is now 7 (not 007 or not 1)!
----
Manual Page -- http://www.php.net/manual/en/function.settype.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+58140
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58140&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+58140&report=yes
Search -- http://master.php.net/manage/user-notes.php