<?php $names = [ " barira, stefan", "cikka , maria", "luppo, martin ", "bill,sebastian", "van gogh , mary jane", ]; var_export( preg_replace('~^\s*([^,]+?)\s*,\s*(.*?)\s*$~', '$2 $1', $names) );
You have javascript disabled. You will not be able to edit any code.