Using variables as href in anchor tags (PHP) [closed]

It’s not really a WordPress related question, but it’s a simple one. The tribe_get_event_website_link() function you are using outputs a full link. You can use SimpleXML to extract the href part and then use it later. It’s as simple as this:

$website = tribe_get_event_website_link();
$xml = new SimpleXMLElement( $website );
echo '<a href="' . $xml['href']. '">REGISTER</a>';

If you are unable to store the functions value inside a variable (for example, if the function echos it), you can use ob_get_clean():

ob_start();

tribe_get_event_website_link();

$website = ob_get_clean();

Now proceed with extracting the href as mentioned above.

tech