i need a regex for ectract meta title, description

exg:
<meta name="description" content="xxxxx">
and
<meta name="Description" content="xxxxx">
and
<meta name="Descriptions" content="xxxxx">
and
<Meta name="Descriptions" content="xxxxx">
and
<META NAME="Description" content="xxxxx">

i want to extract all type od descrptions, same also meta title

thanks your reply, its not getting uppercase meta tage
eg:
<META NAME="DESCRIPTION"
<meta name="Descriptions"

Member Avatar for diafol

Be aware that array keys are case sensitive.

Did you try

$tags = get_meta_tags('http://www.example.com/');

echo $tags['DESCRIPTION'];   
echo $tags['Descriptions'];     
Member Avatar for diafol

What you can do is strtolower the keys in the $tags array and check those.

function cleanMeta($tags)
{
    $keys = array_map('strtolower', array_keys($tags));
    $values = array_values($tags);
    return array_combine($keys, $values);
}

$tags = cleanMeta(get_meta_tags('hangman.php'));

print_r($tags);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.