Hi,
I made a script which analyse very long strings and I need to make it
work differently depending of the 5 first chars of it.
I already do :
switch (true){
case ( ereg("12345", $data) ):
print '$data est un chaine 12345';
break;
case ( ereg("54321", $data) ):
print '$data est un chaine 54321';
break;
default:
print 'invalid data';
}
cause those first chars order doesn't matter, it can't be found in the
same order again ...
I know that there are lots of way to do this with php but could you tell
me which would the fastest way (talking about performance) to do it ?
(in order to make php not to analyse the entire string but only those 5
first chars ....)
thanks a lot,
erick