Welcome Guest, Not a member yet? Register   Sign In
How create variable as variable for globel
#1

In php 
$id       = 1; //this is changeable 
$var     = 'hello'.$id;
$$var = 'result is here';

echo $$var;   // here var is $hello1
echo $hello1;  // same

works fine in php and codeigniter controller works in  one function only.

1. how to use and update $$var all function with in controller ?

 $$var 
create first function .
update another function .
using another function .

How ??
Thanks.
Reply
#2

It would help to know where you are setting these are they Global or in a method?
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(This post was last modified: 08-31-2020, 04:52 AM by Ashok@in.)

(08-31-2020, 04:18 AM)InsiteFX Wrote: It would help to know where you are setting these are they Global or in a method?

var is global
using and changing value of var multiple method func.
within one controller
Reply




Theme © iAndrew 2016 - Forum software by © MyBB