Jump to content

How do I remove: string(0) "" from my results?


soma56

Recommended Posts

<?php
// Assuming the above tags are at www.example.com
$tags = get_meta_tags('http://www.example.com/');

// Notice how the keys are all lowercase now, and
// how . was replaced by _ in the key.
echo $tags['author'];       // name
echo $tags['keywords'];     // php documentation
echo $tags['description'];  // a php manual
echo $tags['geo_position']; // 49.33;-86.59
?>

Sorry Alex.

 

What's happening is that in some instances with the code below I'm receiving:

 

string(0) ""

 

I've tried to dump it and unset it however now it still echo's "NULL"

 

 

[php
<?php
$tags = get_meta_tags('http://www.example.com/');

$data = explode(",", $tags['keywords']);

foreach ($data as $value)
if (empty($value)){
unset($value);
var_dump($value);
} else {
echo $value . "<br />" . PHP_EOL;
flush();
    ob_flush();
    usleep(500000);
}
}

?>[/code]

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.