J. Doe J. Doe - 11 months ago 51
PHP Question

PHP lcfirst not working?

I want to lowercase the first letter of my title.

<title><?php echo lcfirst(bloginfo('name')); ?>.blog</title>

  • This should result into: super.blog

  • But results into: Super.blog

I have tried:

$bloginfo = bloginfo('name');
echo lcfirst($bloginfo);

How is this possible? Am I doing it wrong?


In wordpress, the function bloginfo echos the result. Use get_bloginfo instead.

See code below for the bloginfo function.

function bloginfo( $show = '' ) {
    echo get_bloginfo( $show, 'display' );

See: https://developer.wordpress.org/reference/functions/bloginfo/