note 45520 deleted from function.preg-match by tomsommer

From: Date: Thu, 09 Sep 2004 20:24:55 +0000
Subject: note 45520 deleted from function.preg-match by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-76348@lists.php.net to get a copy of this message
Note Submitter: Dustman ---- 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}.

« previous php.notes (#76348) next »