title: absolute URL link in php from database
body: <p>I have a PHP web application where list of URL of another sites fetch from database and when user click the link they open the external web link in new tab. but whenever I tried to implement this i got relative URL connected to my web app. I want to add an absolute external link.</p>
  <p>in my case in <strong>bookmark</strong> table have fields <strong>bid, id, title, url, date</strong>.</p>
  <p>suppose <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a> is saved in <strong>url field</strong> and when I create link using following code</p>
  <pre><code>&lt;a href=&quot;&lt;?=$bookmark-&gt;url ?&gt;&quot; class=&quot;btn btn-outline-secondary&quot;&gt;Visit&lt;/a&gt;
  </code></pre>
  <p>it open following link</p>
  <p>http://localhost/myapp/bookmark/www.google.com</p>
  <p>but I want to directly open <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a></p>
  <p>how to do this?</p>