Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. $acc_music = mysql_real_escape_string($_POST['acc_music']);
  3.  
  4. function strip_tags_content($text, $tags = '', $invert = FALSE) {
  5.  
  6. preg_match_all('/<(.+?)[s]*/?[s]*>/si', trim($tags), $tags);
  7. $tags = array_unique($tags[1]);
  8.  
  9. if(is_array($tags) AND count($tags) > 0) {
  10. if($invert == FALSE) {
  11. return preg_replace('@<(?!(?:'. implode('|', $tags) .')b)(w+)b.*?>.*?</1>@si', '', $text);
  12. }
  13. else {
  14. return preg_replace('@<('. implode('|', $tags) .')b.*?>.*?</1>@si', '', $text);
  15. }
  16. }
  17. elseif($invert == FALSE) {
  18. return preg_replace('@<(w+)b.*?>.*?</1>@si', '', $text);
  19. }
  20. return $text;
  21. }
  22.  
  23. mysql_query("UPDATE users SET youtube_embed = '".strip_tags_content($acc_music)."' WHERE id = '" . $_SESSION['user']['id'] . "'")or die(mysql_error());
  24. ?>
  25.  
  26. $text = str_replace( array('<', '>'), '', $text);
  27.  
  28. return $text;
  29.  
  30. return str_replace( array('<', '>'), '', $text);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement