SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2009
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with functions within functions.

    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?

  2. #2
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676

  3. #3
    SitePoint Addict Ramiro S's Avatar
    Join Date
    May 2003
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check the variables and how you are storing the returned values. Maybe there is an error and you are not seeing the results because it breaks somewhere.

    Do you have a basic example? I'm assuming you are using something like this

    Script 1

    include ('script2.php');

    script2.php

    function_one() {
    include('function_two.php');
    $a=another_function();
    }

    Script 2 (function_two.php)

    function another_funtion() {
    ...
    }
    Quasar - Web Development - Free Avatars


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •