If you note in my text I had said number. 5.7 is a number. If you want to convert the number to an integer then there are a number of php functions to do that. It all depends on how you want the conversion to be done but a type cast (int) will eventually be necessary.

graeme

BENJAMIN LAMBE wrote:

dont mean to be padantic, but 5.7 is not an integer :p

lol

-----Original Message-----
From: graeme <[EMAIL PROTECTED]>
To: Louis Young <[EMAIL PROTECTED]>
Date: Mon, 17 Jan 2005 13:47:49 +0600
Subject: Re: [PHP-WIN] Newbie question: convert string to int


If you are holding a string with a valid number in it e.g. "5.7" then the conversion is done automatically. See the manual section Language Reference / Types / Strings / String conversion to numbers. If you are holding a string with the number in words e.g. "Five" then you'll need to write your own function for that.

graeme

Louis Young wrote:



Hi there

What's the function to convert a string to an int.

Cheers
Louis







-- Experience is a good teacher, but she sends in terrific bills.

Minna Antrim



Reply via email to