Extract 1st word of blogname/insert in middle of new string

WordPress Website Name (say) = “German Philosophy Politics & Economics”

I want to return “My German Site”

Read More

I have tried the following :

<?php
$myvalue = bloginfo('name');
$arr = explode(' ',trim($myvalue));
$var = $arr[0];
echo "My ".$var." Site";
?>

but it returns “German My Site”

not “My German Site”

Any ideas ?

Related posts

Leave a Reply

1 comment