| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) | ||||
| Senior Member Join Date: May 2005 Location: Ontario Canada
Posts: 3,088
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | why isnt it doing it hey i am reading a PHP ebook and it tells me how to change the type of a string..and i m doing what the book says but it keeps saying that the string is A "STRING" rather then a DOUBLE here is the code PHP Code:
__________________ | ||||
| |
| | #2 (permalink) |
| Buy my domains. Join Date: Feb 2006
Posts: 2,796
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | bool settype ( mixed &var, string type ) Set the type of variable var to type. Possibles values of type are: "boolean" (or, since PHP 4.2.0, "bool") "integer" (or, since PHP 4.2.0, "int") "float" (only possible since PHP 4.2.0, for older versions use the deprecated variant "double") "string" "array" "object" "null" (since PHP 4.2.0) Make it a float? I've never heard of double before. It also needs quotes. settype($number2, "float"); Also, I think you need to make it gettype($number2).. you don't have the $. |
| |