Warning: mysqli_real_connect(): Headers and client library minor version mismatch. Headers:50562 Library:30312 in /home/seotoolh/public_html/memorypointer.com/wp-includes/class-wpdb.php on line 1982
Returning an array from a function in PHP | MemoryPointer.com

Returning an array from a function in PHP

0

Function returning meta tags. Could use database to get  the values

function get_meta_tag()
{
$array["title"] = "My Title";
$array["description"] = "My Description";
$array["keywords"] = "Keywords";
return $array;
}

Calling the function

$myArray = get_meta_tag();

Printing returned values

echo $myArray["title"];
echo $myArray["description"];
echo $myArray["Keywords"];

Get Free Email Updates!

Signup now and receive free offers, discounts & coupon codes

I agree to have my personal information transfered to Mad Mimi ( more information )

I will never give away, trade or sell your email address. You can unsubscribe at any time.

Leave a Reply

Your email address will not be published. Required fields are marked *

CommentLuv badge

This site uses Akismet to reduce spam. Learn how your comment data is processed.