Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

transform alpha to numeric "23" to 23

Status
Not open for further replies.

kafkapower

Programmer
Nov 28, 2001
7
PT
Hi !

This must be a very easy feature, but I'm a fresh starter in PHP, so I need this very bad !

How can I transform the string "23" in the number 23 ?

in C I have atoi, but in PHP, I don't have that function !

Thanks!
 
PHP has automatic type juggling, so often you don't even need to worry about type conversion, but if you want to explicitly change a variable type, you can use settype() -- or you can use type casting -- Read further down on this page:
By the way, the PHP.net site is the best-organized developer reference I have seen yet. One neat feature they have is any string you enter after such as ' automatically either forwards you to the appropriate section in the manual, or runs a sitewide search for that term. Enjoy!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top