I'm in the process of creating a website. Every time the user uploads a link, I need to save the link and its name/value. This is hard to explain.
Here's what I'm trying to say. Lets say the user pastes a link in an input. https://www.google.com/
The link needs to be saved in an XML file. When I call the link:
<a href="<?php whatever the php is ?>"> </a>
I want to also call the name:
<a href="<?php whatever the php is ?>">Google</a>
I want to extract "google" from "https://www.google.com/"
I know I could use:
str_replace(' ', '', )
But not all links are the same. I know this code won't work because I already tried it. I know the right code is simple probably 3 lines. So I would really appreciate it if you guys could help me out.
Thank you.