explode() doesn’t work on get_the_author_meta(‘description’);

I am using the get_the_author_meta('description') function to get the author description in WordPress with this code:

$author_desc = get_the_author_meta('description');
$author_data = explode('>', $author_desc);
var_dump($author_data);

With the description being: E-commerce consultant>man>het e-commerce. I want the explode function to create 3 array items, splitting the string by ‘>’.

Read More

But the result is this:

array (size=1)
  0 => string 'E-commerce consultant>man>het e-commerce' (length=46)

It seems that it DOES put the string in an array, but creates only one row…

Related posts

1 comment

  1. Instead of > char there is entity >. Sou you can explode by this entity string:

    $author_desc = get_the_author_meta('description');
    $author_data = explode('>', $author_desc); // explode by > instead of >
    var_dump($author_data);
    

    Fiddle

Comments are closed.