You are here: Re: Change variable name « PHP SQL « IT news, forums, messages
Re: Change variable name

Posted by strawberry on 04/23/07 13:15

On Apr 23, 1:58 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On 23 Apr, 12:38, strawberry <zac.ca...@gmail.com> wrote:
>
>
>
> > On Apr 23, 10:46 am, "Boris Savc" <boris.s...@siol.net> wrote:
>
> > > Sorry for confuzing subject, but that's the thing I'm trying to achieve. For
> > > example:
>
> > > $a = "Hello";
> > > $b = 1;
>
> > > I want to change the name of $a to $a1 where 1 is value of variable $b!
>
> > > Thanks for all the help,
> > > Boris
>
> > This has nothing to do with sql, but anyway:
>
> > <?php
> > $a = "hello";
> > $b = "world";
> > $a.= $b;
> > echo $a;
> > ?>
>
> That would produce "helloworld"
>
> He didn't say that he wanted to concatenate the contents, he said he
> wanted a new variable name.
>
> I have to wonder why he wants to do this. I would normally use an
> associative array:
>
> $a[$b] = $a;
>
> but you could say:
>
> $b = "a{$b}";
> $$b = $a;
> unset($a);

oops

my turn to skulk away embarrased

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация