J. Doe J. Doe - 1 year ago 122
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?

Answer Source

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/


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download