how to remove word after semicolon using php code example Example: remove behind comma php $print=preg_replace('/^([^,]*).*$/', '$1', $print);