Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with functions within functions.
Old 10-01-2009, 08:19 PM Help with functions within functions.
Skilled Talker

Posts: 53
Name: Wizzy
Trades: 0
So i have one php script that is mostly one function... in this function it requires another script and calls functions
from it. Now I cannot get the first script to see variables made by the required functions even with global. So is there
a way to have a function, call a function from another script and allow the first script to use the variables the
second produces?
virtualmisc is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-02-2009, 02:55 AM Re: Help with functions within functions.
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
how are your files structured? two functions in two separate files linked through an include?

why not form a class and set global in class and call through $this->
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 10-05-2009, 11:17 PM Re: Help with functions within functions.
911
911's Avatar
Novice Talker

Posts: 10
Name: Jesse
Trades: 0
You may want to check out PHP Classes (affectionately known as OOP).

Benefits of OOP,
* Abstract data types and information hiding
* Inheritance
* Polymorphism

OOP can be best described simply as an Object. Think of a car. You have one function for each axle, one function for steering, maybe one for the radio and another for engine. Well each of these functions control a different aspect of the object. Then you using a class, you can steer the car and it will alter the object respectively. May be a bad example but you can get the jist.
__________________
Free Web Hosting -- 250MB Disk / 100GB Bandwidth
No banners, No Ads -- Includes PHP/MySQL

Please login or register to view this content. Registration is FREE
911 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with functions within functions.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.13877 seconds with 12 queries