PHP equivalent of Classic ASP array member reference

In Classic ASP this code would print "s" to the browser window:
Set regEx = New RegExp
regEx.Pattern = "s"
Response.Write regEx.Execute("test")(0)

What would be the PHP equivalent (if any) of the array reference above?

Note my goal with this example is to understand if it is possible directly address a member of a resulting array in one step, or if it is required to use more than one step such as:

echo $match[0];
LVL 27
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

Richard QuadlingConnect With a Mentor Senior Software DeveloperCommented:
It is required. preg_match() returns the number of matches. The actual matches are in the $match array.

A similar question seems to have been previous asked on thsi site:
dr_dedoConnect With a Mentor Commented:
see, preg_match doesn't return an array as most functions would do, it assigns array value to the passed parameter, that's why you can't access it as in asp. you have to do that on two steps
ddrudikAuthor Commented:
I was hoping the answer was different, but thanks for the quick help.
All Courses

From novice to tech pro — start learning today.