This is the example of my string.
$x = \"John Chio - Guy\"; $y = \"Kelly Chua - Woman\";
I need the pattern for the reg replace.
Use the strstr function.
strstr
Example:
$my_string = "This is my best string - You like it?"; $my_new_string = strstr($my_string, '-', true); echo($my_new_string);