JavaScript-How do I match this code with PHP?

Source: Internet
Author: User
Tags xml xpath
I want to match the/musicdata/play/201512/5684f44201b44.mp3 in the code below.

           oooovc:   终于有更新的曲子了!等得花都谢了 DJHarlem:   不错的曲子 值得拥有~ NONGZEMING:   不错!我喜欢! NONGZEMING:   不错!我喜欢! xx602285388:   套曲不错~~~ 155774a:   感谢分享好音乐 1098263279:   非常不错的曲子 376663234:   霸气 不错的套曲 支持 936431866dj:   不错,赞一个 a670529347:   嗨嗨嗨嗨嗨~

Reply content:

I want to match the/musicdata/play/201512/5684f44201b44.mp3 in the code below.

           oooovc:   终于有更新的曲子了!等得花都谢了 DJHarlem:   不错的曲子 值得拥有~ NONGZEMING:   不错!我喜欢! NONGZEMING:   不错!我喜欢! xx602285388:   套曲不错~~~ 155774a:   感谢分享好音乐 1098263279:   非常不错的曲子 376663234:   霸气 不错的套曲 支持 936431866dj:   不错,赞一个 a670529347:   嗨嗨嗨嗨嗨~


  
   终于有更新的曲子了!等得花都谢了 DJHarlem:   不错的曲子 值得拥有~ NONGZEMING:   不错!我喜欢! NONGZEMING:   不错!我喜欢! xx602285388:   套曲不错~~~ 155774a:   感谢分享好音乐 1098263279:   非常不错的曲子 376663234:   霸气 不错的套曲 支持 936431866dj:   不错,赞一个 a670529347:   嗨嗨嗨嗨嗨~EOF;preg_match('/ url="(.+?)"><\/a>/', $a, $b);var_dump($b);

  • XML XPath with PHP is the best

  • XPath syntax participates here XPath syntax

Here's a small example.


  
   xpath("//a[@class='play-item' and @url]");print_r($result);?>

We can find all the elements with a tag class property of ' Play-item ' and URL attributes, and then the SimpleXMLElement class in PHP.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.