Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Thumbs down PHP class extends.... with no memory?

    i've build a simple class that read an xml file into an array,
    look for a specific data
    add an element
    remove an element
    save the all array into same or other file...
    no problem about it

    now, i build some other class, to work on specific xml data file...
    so i extend the previus class, and i add some method...
    even this, it's ok on my local web server...
    not the same on my host...
    where, event if there's no error, the array became empty far away from the point i build it....

    let me show u an example:
    PHP Code:
    // at the begginig i include some class
    include_once("clMenu.php"); // that extends a my xml class...
    $menu=new clMenu("_Xml/vmenu.xml"); // i have to indicate the xml file

    <!-- some HTML CODE -->

    <? // now i use my class
    echo $menu->showHtml();
    the xml class build a global array variable with data in it,
    but when this method (showHtml), use this array, it see an array with 0 element, while i'm sure, at the moment it has been builded it has many element.... (and all works fine on my local web server!)

    any idea?

  2. #2
    i solved...
    it seems like the use of a var, that i recall with the use of $this-> doesn't work...
    but i have to redeclare it with global in every method... and then i can use it..

    maybe there is something i miss in php logic...

Posting Permissions

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