Jump to content

How can i Include an array from another php file?


Jarid

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;
$VALID_RATING_IDS = $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 thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.