Advertisement
hmbashar

copy id from soundcloud url

Sep 10th, 2018
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. <?php
  2. $url = "https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/02&amp;amp;color=ff5500&amp;amp;auto_play=false&amp;amp;hide_related=false&amp;amp;show_comments=true&amp;amp;show_user=true&amp;amp;show_reposts=false";
  3.  
  4. parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );
  5. $url = $my_array_of_vars['url'];
  6.  
  7. $id = substr($url, strrpos($url, '/') + 1);
  8.  
  9. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement