I have a string in the format "EC/1999/MJC/00105" and would like to extract the "1999" part of it (this number changes). Is there a nicer way of doing this than using a loop to select the required characters?
Try this
<? $string="EC/1999/MJC/00105"; $str_array=explode("/",$string);
echo $str_array[1]; ?>
Hth
JBL