I have a list like this stored in a single string: x|y x|y x|y x|y What I want PHP to do is swap the x and y over in each line so it'd look like this: y|x y|x y|x y|x Any ideas?
<?php $string = "x|y"; $parts = explode("|", $string); echo $parts[1],"|",$parts[0]; // out-put y|x ?> PHP: