PHP user created function return values problem

Posted by faX on Programmers See other posts from Programmers or by faX
Published on 2012-06-10T06:36:35Z Indexed on 2012/06/10 10:46 UTC
Read the original article Hit count: 193

Filed under:
|

Okay I'm new here and I have been trying to figure this out all day I have two functions one calling the other but my functions only returns the last value for example 29 when it should return multiple values. As wondering how can I fix this problem so that my functions return all the values.

Here is my PHP code.

function parent_comments(){
    if(articles_parent_comments_info($_GET['article_id']) !== false){
        foreach(articles_parent_comments_info($_GET['article_id']) as $comment_info){
            $comment_id = filternum($comment_info['comment_id']);
            reply_comment_count($comment_id);
        }
    }
}

function reply_comment_count($parent_id){
    if(articles_reply_comments_info($_GET['article_id']) !== false){
        foreach(articles_reply_comments_info($_GET['article_id']) as $reply_info){
            $comment_id = filternum($reply_info['comment_id']);
            $reply_id = filternum($reply_info['parent_id']);

            if($parent_id === $reply_id){
                reply_comment_count($comment_id);
            }   
        }
    }

    return $comment_id;
}

© Programmers or respective owner

Related posts about php

Related posts about functions