Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help! ASP to PHP - Server.CreateObject

304 views
Skip to first unread message

TWINS

unread,
May 31, 2002, 1:33:29 PM5/31/02
to
Hi everyone. I'm migrating an application from ASP to PHP. I can't find
the PHP equivalent for this ASP line:

CreateObject("Scripting.Dictionary");

It must be an instance of a scripting object, but I don't know how to
implement it in PHP. I checked the Win2000 registry, and the
InProcServer for "Scripting.Dictionary" is scrrun.dll... hope it
helps... thanks in advance.

STEFANO

Janwillem Borleffs

unread,
Jun 1, 2002, 4:44:39 AM6/1/02
to

"TWINS" <dsmt...@inwind.it> schreef in bericht
news:3CF7B47B...@inwind.it...

The Scripting.Dictionary object is just ASP's way to create and access
associative arrays.

This ASP example:

<%
Dim d
Set d=Server.CreateObject("Scripting.Dictionary")
d.Add "re","Red"
d.Add "gr","Green"
d.Add "bl","Blue"
d.Add "pi","Pink"
Response.Write("The value of key gr is: " & d.Item("gr"))
%>

Would translate in PHP to:

<?
$d = array();
$d["re"] = "Red";
$d["gr"] = "Green";
$d["bl"] = "Blue";
$d["pi"] = "Pink";
echo "The value of key gr is: ".$d["gr"];
?>

See http://www.php.net/manual/en/ref.array.php for more information about
array functions.

Regards,
Janwillem


0 new messages