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

Conversion number two?

0 views
Skip to first unread message

Brandon Lamb

unread,
Nov 20, 2001, 5:46:10 PM11/20/01
to PHP List
Here is the php version
$required = array('name','address','phone');

Here is the perl version
@required = qw( name address phone );


So is there an easy way in perl for us lazy people so i dont have to use
commas and enter every variable name in single quotes?

Steve Werby

unread,
Nov 20, 2001, 6:16:24 PM11/20/01
to Brandon Lamb, PHP List

I think you mean PHP not perl, but there is a way.

$required = explode( ' ', 'name address phone' );

The code above turns the space separated list into an array.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/

0 new messages