Once you've extracted the number, which is the difficult part, almost anything will do:
<?php
$data = '0000000381';
var_dump( (int)$data );
var_dump( (float)$data );
var_dump( number_format($data) );
var_dump( sprintf('%d', $data) );
... prints:
int(381)
float(381)
string(3) "381"
string(3) "381"
Edit: if you want some other ideas, here's a not fully tested regular expression:
$var = 'LMO0000000381W';
if( preg_match('/^[A-Z]*0*([0-9]+)[A-Z]*$/i', $var, $matches) ){
var_dump($matches[1]);
}
But your system is just fine.