We have 11 guests online
   
PHP Scripts arrow Free PHP Tutorials arrow Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP 
Free PHP Tutorials arrow PHP Tutorials and Examples arrow PHP

Get data between 2 elements or tags
User Rating: / 1
PoorBest 
Retrieves data from between 2 specified beginning and ending elements or tags. Could be used to read data out of an xml document.
  1. <?php
  2. function find($string,$opener,$closer)
  3. {   $part1 = explode($opener,$string);
  4.     $part2 = explode($closer,$part1[1]);
  5.     $result = $part2[0];
  6.     return $result;
  7. }
  8.  
  9. // Example for use:
  10. $string = "<data>Here is stuff</data>"
  11. $data = find($string,"<data>","</data>"); // would set $data to "Here is stuff".
  12. ?>

 

 

Directory Stats

There are 693 listing and 43 categories in our website

Change Language

Current Accounts
Adverse Credit Remortgage
Buy Anything On eBay
Mortgage Calculator
Secured Loans