Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-12-2005, 10:17 PM   PM User | #1
Kura_kai
Regular Coder

 
Join Date: Dec 2004
Posts: 202
Thanks: 0
Thanked 0 Times in 0 Posts
Kura_kai is an unknown quantity at this point
Converting Strings to Numbers

What commands would i have to do to change a string to a number format? Thanks to anyone who helps me
Kura_kai is offline   Reply With Quote
Old 06-12-2005, 10:47 PM   PM User | #2
Kid Charming
Regular Coder

 
Join Date: Jun 2005
Posts: 804
Thanks: 0
Thanked 0 Times in 0 Posts
Kid Charming is an unknown quantity at this point
You can either run it through intval() or settype(), or just cast it as you assign it to a variable:

PHP Code:
$var = (int)yourvalue
Kid Charming is offline   Reply With Quote
Old 06-13-2005, 01:38 AM   PM User | #3
Kura_kai
Regular Coder

 
Join Date: Dec 2004
Posts: 202
Thanks: 0
Thanked 0 Times in 0 Posts
Kura_kai is an unknown quantity at this point
Thank you
Kura_kai is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:50 AM.


Advertisement
Log in to turn off these ads.