PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
function extract_title1($published_page)
{
if (is_array($published_page))
{
foreach ($published_page as $row)
{
$title = $row['title1'];
}
}
display_hm_title($title);
}
But what I really want to do is return $title somewhere else before sending it to another function. ie I want to return $title, but I can't. I've tried several derivations of the following but it's failing to return $title every time:
In your function(s) you should look at making title an array or atleast one long string and passing the array through the return. The way you have it setup is you repeatedly overwrite $title and return the last instance of it.
i dont really see the point of what your code is doing but i dont think you can do $row['title1'] like with mysql i think you should try $row[0] or w/e element it is you are trying to extract.