Structures and PHP
| From: | Terrence Cox | Date: | Mon, 02 Sep 2002 14:06:50 +0000 |
| Subject: | Structures and PHP | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-87785@lists.php.net to get a copy of this message | ||
Knowing that I can't create actual structures in PHP, I recently realized I could do something
like this.
<?php
function create_Struct($struct_array)
{
$struct_array=array(
conn => 0,
host => "",
u_name => "",
pass => "",
db => ""
);
return $struct_array;
}
$db_struct = create_Struct($db_struct);
$db_pointer = &$db_struct;
print_r($db_pointer);
?>
What I'm curious about is the possibility of making
something like this "built in", for lack of a better term. I've heard a number of C
guys asking about this on some message boards and came up with this as a result.
Is there a better way? What do you guys think?
Later on,
TRC
--
_______________________________________________
Get your free email from http://mymail.operamail.com
Powered by Outblaze