mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-26 14:49:56 +09:00
Support order_default attribute to <index> tag in XML query
This commit is contained in:
parent
2a3f5d3c51
commit
4cc730e489
4 changed files with 12 additions and 10 deletions
|
|
@ -11,17 +11,17 @@ abstract class BaseParser
|
|||
* Get all attributes of an element as an associative array.
|
||||
*
|
||||
* @param SimpleXMLElement $element
|
||||
* @param bool $remove_symbols
|
||||
* @param bool $normalize
|
||||
* @return array
|
||||
*/
|
||||
protected static function _getAttributes(\SimpleXMLElement $element, $remove_symbols = true): array
|
||||
protected static function _getAttributes(\SimpleXMLElement $element, $normalize = true): array
|
||||
{
|
||||
$result = array();
|
||||
foreach ($element->attributes() as $key => $val)
|
||||
{
|
||||
if ($remove_symbols)
|
||||
if ($normalize)
|
||||
{
|
||||
$key = preg_replace('/[^a-z]/', '', $key);
|
||||
$key = strtolower(preg_replace('/[^a-zA-Z]/', '', $key));
|
||||
}
|
||||
$result[trim($key)] = trim($val);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue