note 45520 added to function.preg-match
| From: | Dustman at osu1 dot php dot net | Date: | Thu, 09 Sep 2004 15:41:08 +0000 |
| Subject: | note 45520 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76333@lists.php.net to get a copy of this message | ||
rchoudhury --} pinkgreetings {-- com,
That is an interesting way of doing it but why not just use multiple case statements without breaks?
I belive that is the standard way of doing the same thing.
<?php
// stuff
foreach (func_get_arg(0) as $key => $value) {
switch ($key) {
case "meta_keywords":
case "meta_desc":
case "doctype":
case "xmlns":
case "lang":
case "dir":
case "charset":
$this->g_page_vars[$key] = $value;
break 1;
case "site_title":
case "site_desc":
case "site_css:
$this->g_page_vars[$key] = $g_site_vars[$key];
break 1;
}
// do stuff inside loop
}
// etc
?>
However, I can see usefullness if you were actually matching a regex statement such as [A-z]{3,5}.
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45520
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45520&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45520&report=yes
Search -- http://master.php.net/manage/user-notes.php