how do you access an array in an included/required field?

From: NotGiven (noname_at_nonegiven.net)
Date: 11/29/03


Date: Sat, 29 Nov 2003 10:58:24 -0500

I have a large array that would be messy to include in the file "main.php"
itself and would prefer to include/require it. Say I have the following
line in "main.php":

                         require_once('/arr.php');

And the "arr.php" file looks something like this:

<?php
array(1)='ok1@Ok.com';
array(2)='ok2@Ok.com';
array(3)='ok3@Ok.com';
array(4)='ok4@Ok.com';
array(5)='ok5@Ok.com';
array(6)='ok6@Ok.com';
array(7)='ok7@Ok.com';
array(8)='ok8@Ok.com';
array(9)='ok9@Ok.com';
array(10)='ok10@Ok.com';
?>

Would I be able to reference the array AS IF I had declared the array in
"main.php"?

I am a programmer but new to PHP.

Many thanks.



Relevant Pages

  • Re: Need help on PHP for MPE/ix
    ... Here is the syntax of the dbupdate intrinsic in PHP: ... assoc array of item values) ... Please let me know if you have any more suggesstions to solve this problem. ... Pavan Kumar Rati wrote: ...
    (comp.sys.hp.mpe)
  • Re: Using a RegEx as a "variable" WITHIN an array?
    ... believe the PHP one is also based upon. ... combination of 1 or more numerics in this instance would give you your ... add this to your array - you could then do a pattern match on the array ... > Dim selCriteria as String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Need help on PHP for MPE/ix
    ... If one item is an array, it must be declared as such in the list ... So, please show us the declaration of the record buffer, and its ... Of Pavan Kumar Rati ... Need help on PHP for MPE/ix ...
    (comp.sys.hp.mpe)
  • Re: attempting to return values from array from w/in a function
    ... What I get is an array w/ only the most recent array entry. ... I am new to PHP & do not have formal scripting ... you end up comparing strings, but the test you mean probably is simply: ... case 1: {codeblock} ...
    (comp.lang.php)
  • Re: Advice about fetching user information
    ... but actually *selecting* them in MySQL ... PHP scripts and use a gaugefunction to time pretty much every ... The same is pretty much true for searching an array in PHP - ... But I wouldn't be searching. ...
    (comp.lang.php)