Difference between revisions of "PHP:Convert a String to a Number"

From Progzoo
Jump to: navigation, search
(New page: ==String to int== <question lang="php" className="Demo"><prog><![CDATA[ <? $s = "1234"; echo $s+1; ?> ]]> </prog> <p> The language will automatically convert the string to an integer as re...)
 
Line 1: Line 1:
==String to int==
+
{{topTenTips}}
 
<question lang="php" className="Demo"><prog><![CDATA[
 
<question lang="php" className="Demo"><prog><![CDATA[
 
<?
 
<?

Revision as of 21:18, 31 December 2007

The language will automatically convert the string to an integer as required.

The value "1234" is a string, you need to treat it as a number - to add 1, giving 1235.

[Font] [Default] [Show] [Resize] [History] [Profile]