Been scratching my head all morning and cannot seem to think of a logical quick way of doing this, without using alot of resources.
Here is the scenario,
$content = "hello this is a lovely website that people help me with and i love it";
$arrayto = array("good morning","hello","good afternoon","morrow");
$website = "http://www.google.com";
I would like to check the $content and if it contains one of the arrays words and if it does turn it into a link using the $website
as the href=""
, and then stop as soon as it finds one.
So then $content
would be "<a href="$website">hello</a> this is a lovely website that people help me with and i love it";
.
Thanks