Jump to content

How can i Include an array from another php file?


Recommended Posts

Here is a section of php file A

include_once(dirname(__FILE__) . '/PhpfileB.php')
$VALID_RATING_IDS = $Ratethese


Here is all of php file B

$Ratethese = "array("1", "2",);"



I need the var $VALID_RATING_IDS to = $Ratethese from file B


I am trying to include an array from php file B in php file A. Is this possible? How can i accomplish this?

Link to comment
Share on other sites

PhP File A

include_once(dirname(__FILE__) . '/PhpFileB.php');
global $Ratethese;


Php File B

$RATETHESE = "array("1", "2");"


For some reason it is printing the array on the page, and the array is not being used to run the script. Did i do anything wrong?

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.