Re: Assign value to variable
Works like a charm. It was that double $$ that I could not wrap my
head around. Thanks very much!
Geoff Berrow <blthecat@ckdog.co.uk> wrote in message news:<qhcem098np84rd76og0e2ngkqv9ro3u92c@4ax.com>. ..
> I noticed that Message-ID:
> <d3354680.0410080907.4c50e18b@posting.google.com > from Mike contained
> the following:
>
> >ie. somefunc("sn", "Shore")
> >
> >Would create the variable $sn and assign the value "Shore" to it.
>
> function somefunc($var,$value){
> global $$var;
> $$var=$value;
> }
> somefunc("sn", "Shore");
> print $sn;
|