without using an echo or print or print_r
and instead by using return
example:
Code: Select all
function id_helper($id_selector)
{
foreach ($id_selector as $key[]=> $value)
{
return $value[$this->idtype()];
}
}
echo id_helper($_GET['article_id']);the above function would only show the last(or first) ID number available
I want all possible article id numbers to be displayed intead of just the last(or first) one
Using echo/print is not an option, otherwise this wouldn't be a problem for me.
p.s.
the function probably will not make sense to people,
as I use this method within a class to be used in other classes
to quickly grab article id numbers during runtime....
however, the concept and question for foreach's to spit out all available
output without using echo is still the same ;x