Here's a quick project: there's a 90 line Perl script with info in this format:
if($section eq 'Dowles') {
$sections{$sku} = "dowels";
} elsif ($section =~ /^H\d+/i or $section eq 'NonstockB' or $section eq 'CORBELS') {
$sections{$sku} = "smal";
rewrite it in PHP like so:
public function getParticular( $sku, $section )
{
if($section eq 'Dowles') {
return = "dowels";
} elseif ([regex-match] or $section == 'NonstockB' or $section == 'CORBELS') {
return "smal";
}
The PHP class and function are already written for you, along with a test module.