I just noticed a bug in that code. The $len should be $len($6) not $len($5). Sorry