Check for href in string


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (preg_match('/href="([^"]*)"/i', $results , $regs))
  2. {
  3. $url = $regs[1];
  4. } else {
  5. $url = "No URL Found";
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.