[UPHPU] Help me simplify this bit of code please?

Ash ashovi at qwest.net
Mon Aug 25 14:58:31 MDT 2008


Sorry, I forgot to add another line of the code that makes it so that 
substr won't work, at least reading from right to left. From left to 
right, it will, because there is always 2 chars for the description, but 
perhaps only 1 for the year.


case 'FF2':
                             $series_year = "2"; 
       		            $series_description = "/FF";
                     break;

I'm sure there's a way to make substr read from left to right, but I 
don't know how to do the counting for it.

Ash

> $servies_year = substr($series,0,2);
> $servies_year = substr($series,2,2);
> 
> something along those lines may work.
> 
> On Mon, Aug 25, 2008 at 1:31 PM, Ash <ashovi at qwest.net 
> <mailto:ashovi at qwest.net>> wrote:
> 
>     switch ($series)
>                    {
>                    case 'FF12':
>                            $series_year = "12";
>                            $series_description = "/FF";
>                    break;
> 
>                    case 'FF13':
>                            $series_year = "13";
>                            $series_description = "/FF";
>                    break;
> 




More information about the UPHPU mailing list