PHP regular expression to remove a number, then a space?

How can I remove numbers and space from the beginning of a line?

For example, from '13 Adam Court, Cannock ', delete' 13 '

Thank!

(Apologies for the almost duplicate, I realized that you need to use PHP for this)

0
source share
5 answers

Use the same expression that I gave in the JavaScript response , but apply it using preg_replace():

preg_replace('/^\d+\s+/', '', $str);
+1
source

Since everyone else goes along the \ d + \ s route , I will give you the answer of a dead brain

$str = preg_replace("#([0-9]+ )#","",$str);

, / , - http://

:)

+2

:

^\d+ (.*)$

:

preg_replace ("^\d+ (.*)$", "$1" , $string);

:

:

+1

/^\d+\s+/

^\d+

it \s+

, -...

\d 0,1,2,3,4,5,6,7,8,9.

\s .

(+) , ...

\d+ ()

\s+ ( ..)

+1

, , - . preg_replace().

/^[\s\d]+/ . :

$str = preg_replace(/^[\s\d]+/, '', $str);

. -, , , . BoltClock.

+1

All Articles