i need help with my project. i need a PHP code to display
i need help with my project. i need a PHP code to display the word
length of each word in the given quote and have them be separated by commas.
ex. hello mr blue sky
output : 5,2,4,3
the code i have so far does not produce any output. i looked at the string functions table and have not come across any functions. Maybe im missing something or that i need to use a forreach array or multiple functions. any help is appreciated.
//my source code
<h1> Bruce Lee Quote </h1>
//main quote
<?php
$quote= “I fear not the the man who has practiced ten thousand kicks once, but i fear the man who has practiced one kick ten thousand times. -Bruce Lee”;
echo $quote;
?>
<br>
<br>
<?php
//function to make words all upper case
$uquote = ucwords($quote);
echo $uquote;
?>
<br>
<br>
//This is the function im having trouble with
<?php
foreach($quote as $lenquote){
echo $lenquote, ‘=>’, mb_strlen($lenquote),'<br>’;
}
?>
<br>
<br>
</body>
</html>
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
