<?php
$test = 'Ontario, Montreal, Quebec';
?>
How do I href each word like this with current full url of the page from single variable but multiple words to href each seperately.
<a href="http://www.domain.com/canada">Ontario</a> <a href="http://www.domain.com/canada"> Montreal</a> <a href="http://www.domain.com/canada"> Quebec</a>
This is a simple application of
explode, which splits a string into multiple substrings based on a delimiter, in this case “, “.