Jump to content
php.lv forumi

Problema Preg match


GeRik

Recommended Posts

Varbūt derētu palasīt php.net manuāli funkcijai?

 

preg_match() returns the number of times pattern matches. That will be either 0 times (no match) or 1 time because preg_match() will stop searching after the first match. preg_match_all() on the contrary will continue until it reaches the end of subject . preg_match() returns FALSE if an error occurred.

 

Varbūt labāk papēti preg_replace() funkciju...

 

 

Labi, būšu dāsns:

$result = preg_replace('/[^0-9]/', '', $subject);

Edited by briedis
Link to comment
Share on other sites

Varbūt derētu palasīt php.net manuāli funkcijai?

 

 

 

Varbūt labāk papēti preg_replace() funkciju...

 

 

Labi, būšu dāsns:

$result = preg_replace('/[^0-9]/', '', $subject);

Liels Paldies :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...