You know, what you can do (strongly not recommended, but still) is to insert
that whole thing into a database and then pull this string out and pass it
through eval().

ie: eval($record);

another way would be to take all that, addslashes($it) and then write into a
file with stripslashes($it).

But, you are going to need that statement to be a string, not code.
Otherwise you can "read yourself", fread() your own file to take your code
as a string.


After all, those are kinda silly methods. I am sure you can find a better
solution for your needs. Storing codes is a very powerful but not always
necessary procedure.

Cheers,
Maxim Maletsky
www.PHPbeginner.com




-----Original Message-----
From: 602e23 [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 18, 2001 12:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP] question from a php newbie




I'm so new to this, in fact, that I may not be able to
even frame my question correctly.  Please bear with me.

Suppose that I had a list in a data base of, say, countries
and that I built an array as

$states = array (
                array("abbr"=>"MA", "name"=>"Massachusetts"),
                array("abbr"=>"NY", "name"=>"New York"),
                array("abbr"=>"CA", "name"=>"California"),
                               [. . .]
                )

is there a way to dump this array in a form which would allow
it to be written to an 'include' file.  I tried both var_dump
and print_r but neither method seems to have worked correctly.
The actual array which I have in mind is much more complicated
structurally than the states array shown above, but it is
unlikely to change more than once a day so it seems wastefull
to probe the database each time a copy is needed.

av0-


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to