Jump to content

I didn't know we could do this


Gayner

Recommended Posts

I did a query in my index.php and my results can be seen when i put in a different .php and include it hahaha epic..

 

so like

 

in my index.php i got results from table {$data['id']} and i use include 'profile.php' then i put {$data['id']} in my profile.php at very top and it WORKS HAAA

 

This is epic is there any other stuff i can do ?

 

This is will help so much, now my 5000 line index.php can become cleaner! hahaha

Link to comment
https://forums.phpfreaks.com/topic/184941-i-didnt-know-we-could-do-this/
Share on other sites

From the include() page of the php manual -

When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward.

From the include() page of the php manual -

When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file, from that point forward.

 

HAha awesome bro thanks this is great help ty

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.