To swap $a and $b:
list($a,$b) = array($b,$a);
Latest Technology, Windows 7, Windows 8, Business, Bollywood News,Internet news, reviews
list($a,$b) = array($b,$a);
$fruits = array('red' => array('strawberry','apple'), 'yellow' => array('banana'));
while ($obj = mysql_fetch_object($r)) { $fruits[ ] = $obj; }
<?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']; // nameecho $tags['keywords']; // php documentationecho $tags['description']; // a php manualecho $tags['geo_position']; // 49.33;-86.59?>
header('Location: destination.php'); exit();
ou need the Location:
part so the browser knows what header it's
receiving. Also, don't forget to
do anexit()
ordie()
right after the redirect.
$position = array_search($value, $array); if ($position !== false) { // the element in position
//$position has $value as its
//value in array $array }
// make a comma delimited list $string = join(',', $array);
$string = ''; foreach ($array as $key => $value) { $string .= ",$value"; } $string = substr($string, 1); // remove leading ","