RE: [PHP] split
| From: | John W. Holmes | Date: | Fri, 28 Mar 2003 00:45:36 +0000 |
| Subject: | RE: [PHP] split | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141339@lists.php.net to get a copy of this message | ||
> I want to make a loop.Like $a = "123"; //$a is One two threw not
> hundred...
> and i want to make for each $a then $b = $a + 2
>
> The output will be.
> 3 (1+2)
> 4 (2+2)
> 5 (3+2)
>
> Any example?
$a = "123";
$c = '';
$b = strlen($a);
for($x=0;$x<$b;$x++)
{ $c .= $a{$x} +2; }
echo $c;
---John W. Holmes...
PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/