Guest User

Untitled

a guest
Feb 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. /**
  2.  * Function to prepare data for return to client
  3.  * @access private
  4.  * @param string $data
  5.  */
  6. function objectify( $data )
  7. {
  8.     if( $this->type ==  'json' ) {
  9.         if (function_exists(json_decode)){
  10.             return json_decode( $data );
  11.         }
  12.     }
  13.     else if( $this->type == 'xml' )
  14.     {
  15.         if( function_exists('simplexml_load_string') ) :
  16.             $obj = simplexml_load_string( $data );     
  17.         endif;
  18.         return $obj;
  19.     }
  20.     else
  21.         return false;
  22. }
Add Comment
Please, Sign In to add comment