Answers for "strreplace php regex"

PHP
0

replace all numbers in string php

$words = preg_replace('/[0-9]+/', '', $words);
Posted by: Guest on October-21-2020
2

preg_replace

<?php
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
$replacement = '${1}1,$3';
echo preg_replace($pattern, $replacement, $string);
Posted by: Guest on August-02-2020

Browse Popular Code Answers by Language