NYCPHP Meetup

NYPHP.org

[nycphp-talk] convert str array to int ???

Analysis & Solutions danielc at analysisandsolutions.com
Thu Mar 20 13:35:10 EST 2003


Hi Tracy:

On Thu, Mar 20, 2003 at 01:07:08AM -0500, Tracy wrote:
> 
> i have a script which works with integers. i am taking the inputs from 
> a form and now it defaults to string.

Pardon me for yet another quick answer, but why do you need them as 
integers?  PHP automatically converts variables' data types as needed for 
the purpose at hand.  For example:

    $one = '1';
    $two = '2';
    echo "$one + $two = " . ($one + $two);

--Dan

-- 
               PHP classes that make web design easier
    SqlSolution.info  | LayoutSolution.info |  FormSolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7th Ave #4AJ, Brooklyn NY    v: 718-854-0335   f: 718-854-0409



More information about the talk mailing list