i am trying to split strings like the one below ready for insertion in to a database.

John Smith -- Operation Manager

the string must be split on the -- with everything before it going in to one array and everything after into another.
At least thats the thoery anyway.

    THanks leatherback the explode worked great.

    Array (
    [0] => John Smith
    [1] => Operation Manager
    )

    One last thing how do i extract this data from the array for example the job title Operation Manager?

    thanks in advance.

      Well, if it's always the second element, you'd just access it like you would any other array element... e.g. $array[1] (see manual page [man]language.types.array[/man] for more info).

        Write a Reply...