Write a PHP function that accepts a string of words It needs

Write a PHP function that accepts a string of words. It needs to find any word in the string that starts with the character \'#\'. If found, echo that word.

Solution

$line = readline(\"Enter a sting of words: \");

$words = explode(\" \", $line);

for($i=0;$i<count($words);$i++)

{

if(substr($words[$i],0, 1) == \"#\")

{

echo $words[$i];

}

}

Write a PHP function that accepts a string of words. It needs to find any word in the string that starts with the character \'#\'. If found, echo that word.Solu

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site