PHP trim

Hi Guys,

I have a variable set $test which is equal to something in the form of: '123/3455.20". The number before and after the slash change in both value and length I am trying to set two separate variables. One of the number before the slash and one of the number after the slash.

I think I need to use the trim function but up searching I can only find ways to trim a fixed number of characters.


see explode()

Ah brilliant. Thanks. This should work then?

$test = “123/32894.34”;
$output = explode(“/”, $test);
$number1 = $output[0];
$number2 = $pieces[1];

Thanks again.

little syntax sugar from creators of PHP:
$test = “123/32894.34”;
list($number1,$number2) = explode(“/”, $test);