Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem with include in PHP
    primarykey
    data
    text
    <p>I have a php file called Route.php which is located on:</p> <p>/var/www/api/src/fra/custom/Action</p> <p>and the file I want to include is in:</p> <p>/var/www/api/src/fra/custom/</p> <p>So what I have inside route php is an absolute path to the two php file I want to include:</p> <pre><code>&lt;?php include '/var/www/api/src/frapi/custom/myneighborlists.php'; include '/var/www/api/src/frapi/custom/mynodes.php'; ............ ........... ?&gt; </code></pre> <p>These two file has an array of large amount of size that I want to use in Route.php. When I do vardump($global) it just returns NULL. What am I missing here?</p> <p><strong>UPDATE:</strong></p> <p>I did an echo on the included file and it prints something, so therefore it is included.. however I can't get access that array... when I do a vardump on the array, it just returns NULL!</p> <p>I did add a global $myarray inside the function in which I want to access the array from the other php file</p> <p>Sample myneighborlists.php:</p> <pre><code>&lt;?php $myarray = array( 1=&gt; array(3351=&gt;179), 2=&gt; array(3264=&gt;172, 3471=&gt;139), 3=&gt; array(3467=&gt;226), 4=&gt; array(3309=&gt;211, 3469=&gt;227), 5=&gt; array(3315=&gt;364, 3316=&gt;144, 3469=&gt;153), 6=&gt; array(3305=&gt;273, 3309=&gt;171), 7=&gt; array(3267=&gt;624, 3354=&gt;465, 3424=&gt;411, 3437=&gt;632), 8=&gt; array(3302=&gt;655, 3467=&gt;212), 9=&gt; array(3305=&gt;216, 3306=&gt;148, 3465=&gt;505), 10=&gt; array(3271=&gt;273, 3472=&gt;254), 11=&gt; array(3347=&gt;273, 3468=&gt;262), 12=&gt; array(3310=&gt;237, 3315=&gt;237)); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload