I am having a devil of a time trying to get my arrays to print right, but I am missing something. I am hoping another set of eyes can help me figure it out. I have this current function:
function getArrayUsers($id) {
$sql = DB::inst()->query( "SELECT * FROM " . TP . "users WHERE id = '$id' AND confirmed = '1' AND unsubscribe ='0'" );
$rows = array();
while($r = $sql->fetch_assoc()) {
$rows[] = $r['address'];
}
return $rows;
}
Currently, the results of this function print out like so:
Array ( [0] => test@gmail.com [1] => test2@gmail.com )
Now, I will need this output at some point, but I need to do this in two steps. First, I need the result of the function to first print out the results like so:
'test2@gmail.com','test2@gmail.com';
Then what I want to do is take my custom function's result and run it through the PHP array function to achieve the array I mentioned earlier.
I have tried several ways of trying to accomplish this, but I've been looking at it too long. The only time that I've come close was when echoing the results in the function. However, I always try to avoid that and it echos the result on the page as well, which is what I don't want. If anyone can help me with this, will greatly appreciate it.