Dynamic variable names in PHP ?

The place for general PHP questions and hints for PHP on IBM i

Dynamic variable names in PHP ?

Postby maha96 on Thu Jun 08, 2017 7:04 pm

I'm trying to use dynamic variable names (I'm not sure what they're actually called) But pretty much like this:

for($i=0; $i<=2; $i++) {
$("file" . $i) = file($filelist[$i]);
}

var_dump($file0);
he return is null which tells me it's not working when i applied to fathers day quotes php web design
maha96
 
Posts: 1
Joined: Thu Jun 08, 2017 7:02 pm

Re: Dynamic variable names in PHP ?

Postby liam9130 on Tue Jun 13, 2017 8:11 am

I was also trying to use this coding but was unable to implement and achieve the result. I am also looking for the answer as i got an assignment to be submitted by next week. I am also looking for the assignment writing service as well because they know how to write these kinds of assignments.
liam9130
 
Posts: 1
Joined: Tue Jun 13, 2017 7:53 am
Location: United Kingdom

Re: Dynamic variable names in PHP ?

Postby judy6640 on Sat Jun 17, 2017 11:30 am

How to dynamically create an object with parameter passing to the constructor?
judy6640
 
Posts: 9
Joined: Sat Jun 17, 2017 10:07 am

Re: Dynamic variable names in PHP ?

Postby sara8275 on Fri Aug 18, 2017 7:55 am

To simply solve this issue, take help from different developers and designers around you. some problems need to sort out by personal research and solutions. Dynamic variables is not a big issue overall, however, it may give you a tuff time if you are missing some ordinary command.
sara8275
 
Posts: 1
Joined: Fri Aug 18, 2017 7:47 am
Location: Dubai


Return to PHP Questions / Hints

Who is online

Users browsing this forum: No registered users and 2 guests