fn_simplexml_attribute

Get a simplexml attribute (helper function).

Description

(string) fn_simplexml_attribute( $xml, (string) $name ); 

Returns (string)

Parameters (2)

0. $xml
The xml.
1. $name (string)
The name.

Usage

  1. if ( !function_exists( 'fn_simplexml_attribute' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-payment-gateway-for-saferpay/fn-saferpay.php'; 
  3.  
  4. // The xml. 
  5. $xml = null; 
  6.  
  7. // The name. 
  8. $name = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = fn_simplexml_attribute($xml, $name); 
  12.  

Defined (1)

The function is defined in the following location(s).

/fn-saferpay.php  
  1. function fn_simplexml_attribute($xml, $name) 
  2. {  
  3. foreach($xml->Attributes() as $key=>$val) 
  4. if($key == $name) 
  5. return (string) $val; 
  6.  
  7. return ""; 
  8. }