Changeset 862 for trunk/include/functions_xml.inc.php
- Timestamp:
- Sep 14, 2005, 11:57:05 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_xml.inc.php
r675 r862 57 57 else return ''; 58 58 } 59 60 function deprecated_getAttribute( $element, $attribute )61 {62 // Retrieving string with tag name and all attributes63 $regex = '/^<\w+( '.ATT_REG.'="'.VAL_REG.'")*/';64 preg_match( $regex, $element, $out );65 66 // Splitting string for retrieving separately attributes67 // and corresponding values68 $regex = '/('.ATT_REG.')="('.VAL_REG.')"/';69 preg_match_all( $regex, $out[0], $out );70 71 // Searching and returning the value of the requested attribute72 for ( $i = 0; $i < sizeof( $out[0] ); $i++ )73 {74 if ( $out[1][$i] == $attribute )75 {76 return $out[2][$i];77 }78 }79 return '';80 }81 59 82 60 // The function getChild returns the first child
Note: See TracChangeset
for help on using the changeset viewer.