I have some data in the following format.
Orange - $3.00
Banana - $1.25
I would like to print this only as follows:
Orange
Banana
I tried using the following code in a loop, but the data may have 0 in other places. Therefore, if I can find 0 only at the end for a specific string.
$pos=strpos($options, "0");
$options = substr($options, 0, $pos)."\n";
Any ideas?
Raj k source
share