php - How can I update this statement to be preg_replace -
as title states can indicate how can correctly update line of code is:
$payment_number = ereg_replace(" |-", "", @$_session['ccdata']['order_payment_number']);
to preg_replace
correctly.
there no need regular expressions! can solve using simple str_replace
:
$payment_number = str_replace(array(" ", "-"), "", @$_session['ccdata']['order_payment_number']);
in case want use regular expressions anyway, have add delimiters make preg compatible:
$payment_number = preg_replace("/ |-/", "", @$_session['ccdata']['order_payment_number']);
Comments
Post a Comment