[Omaha.pm] explode gt split

Andy Lester andy at petdance.com
Mon Jun 23 08:58:19 PDT 2008


On Jun 23, 2008, at 10:55 AM, Jay Hannah wrote:

> Wow. PHP's explode() is a much cooler name than Perl's boring old
> split().
>
> <?php
>     $expFileNames  = `ls -t output/`;
>     $expFileNames  = explode("\n",$expFileNames);
> ?>


Too bad you can't just get a list anyway, like in Perl:

$file_list_as_string = `ls -t output/`;

@file_list           = `ls -t output/`;

Might as well just go directly to the array, eh?

xoa


--
Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance






More information about the Omaha-pm mailing list