Link to home
Start Free TrialLog in
Avatar of ddrudik
ddrudikFlag for United States of America

asked on

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:

<?php
preg_match('/s/','test',$match);
echo $match[0];
?>
Avatar of LordWolfy
LordWolfy
Flag of United Kingdom of Great Britain and Northern Ireland image

A similar question seems to have been previous asked on thsi site:

https://www.experts-exchange.com/questions/22910308/RegEx-ASP-to-PHP-Conversion.html
ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddrudik

ASKER

I was hoping the answer was different, but thanks for the quick help.