07-03-2008, 01:19 AM
|
#2 (permalink)
|
|
The Gregarious
Join Date: Mar 2008
Location: Cana'derr
Posts: 653
Thanks: 24
|
The same one, if I understand what you want to do. A simple modification of Wildhoney's original class would include another almost identical function:
PHP Code:
public function parsePhrase($szItem, $szVar) { $aItem = $this->m_pXML->xpath(sprintf("//phrase[@id='%s']", $szItem)); $szItem = empty($aItem[0]) ? null : (string) $aItem[0]; return sprintf($szItem, $szVar); }
You could continue to build on this in various ways, by using func_get_args, or by allowing $szVar the possibility of being an array which you could explode and use in the sprintf, and so on and so forth.
-m
|
|
|
|