Results 1 to 7 of 7
Threaded View
-
8th Jan 2011, 04:55 PM #1OPMemberWebsite's:
epicimagehost.com[PHP][Help]Redeclare A function
Right now file-remoter is having a shitload of functions.
If I want to generate rapidshare remoteable links I called the function:
$links .= gen_rs_links($links);
At first I didn't see any harm. The code is cluttered but it's still readable.
But now I'm supporting 11 hosts.
Each host has it's own functions ( main function, grab cookies, check links )
I was rewriting it so I could just do a
PHP Code:foreach($dlinks as $host => $urls){
$links .= generate_links($host,$urls);
}
PHP Code:function generate_links($host,$links){
include('/path/inc/'.$host.'.php');
return link_gen($links);
}
But apparantly, even in a function. The scope of functions included using the include function is global.
So I figure that if I have to generate links for multiple hosts, an error will come because I include a function that's already been declared before.
Any ideas?Robin H Reviewed by Robin H on . [PHP]Include functions scope Right now file-remoter is having a shitload of functions. If I want to generate rapidshare remoteable links I called the function: $links .= gen_rs_links($links); At first I didn't see any harm. The code is cluttered but it's still readable. But now I'm supporting 11 hosts. Each host has it's own functions ( main function, grab cookies, check links ) Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
(VB6) Using functions
By JasonCairns in forum Web Development AreaReplies: 0Last Post: 10th Jan 2012, 01:10 PM -
[For Hire] PHP Functions
By _Vick in forum Completed TransactionsReplies: 0Last Post: 3rd Dec 2011, 10:28 AM -
PHP Functions
By Hydrode in forum General DiscussionReplies: 3Last Post: 7th Feb 2011, 08:05 PM -
Scope Hosts - VPS Unmanaged
By Raven in forum Technical Help Desk SupportReplies: 11Last Post: 19th Jul 2010, 11:26 AM
themaCreator - create posts from...
Version 3.51 released. Open older version (or...