The syntax of PHP and Perl are very similar. Here's the Perl script from the ALPHA resource. I'm sure you know how to convert for loops / etc to Perl in PHP. If you are unsure of the syntax, search for Perl or Internet documents and find the equivalent in PHP. You should be able to develop an equivalent PHP script by looking at the Perl sample.
source
share