I want to make phone no and links both clickable in PHP

I want to make phone no and links clickable by replacing like below

this simple PHP string

"Call me at 9831234568 or 9065876543 or find me in http://google.com or http://www.test.com"

became html code like

Call me at <a href="tel:9831234568">9831234568</a> or <a href="tel:9065876543 ">9065876543</a> or find me in <a href="http://google.com">http://google.com</a> And <a href="www.test.com">www.test.com</a>

PHP Function like

function make_phnoandurl__clickable($text){
    // ???
}

$text = 'Call me at 9831234568 or 9065876543 or find me in http://google.com or http://www.test.com
';

echo make_phnoandurl__clickable($text);

If you echo within html tags you should be able to render the line however you’d like using normal HTML tags, is this what you are looking for?

<!DOCTYPE html>
<html>
<body>

<?php
echo "<h2>PHP is Fun!</h2>";
echo "Hello world!<br>";
echo "I'm about to learn PHP!<br>";
echo "This ", "string ", "was ", "made ", "with multiple parameters.";
?> 

</body>
</html>```