hey need some brief help with arrays!

heres the code:
NOTE: i dont want to use date function or variables

$start_data = "01/03/2003";

// i want to get somevariable to equal 03 which would be
//the month

$some_var = $start_data[3] concatenated with start_data[4];

//without adding them.

thanks,

Lee

    Not sure exactly what you are trying to do but to get the month part from the string use where 3 would be the starting point and 2 would be the number of characters to pull:

    $month = substr($some_var, 3, 2);

    To concat the two vars

    $string = $var1 . $var2;

    HTH

    rinjani

      Well, if you dont want to use variables, then why use PHP?

      Anyway, another method, since you mentioned arrays, would be to use explode(), after which the array obtained would have index 1 as the required string.

        thanx anyways bit i figured out another way to do it.

        thanks again,

        Lee

          Write a Reply...