function cpp_test() { $page = get_page('http://blog.csdn.net/tlovet1314/article/details/5299490'); $codes = get_cpp_codes($page); foreach ($codes as $code) { echo $code; } }
function get_answers($problem) { $page = search_by_haosou($problem); $urls = get_csdn_urls($page); $answers = array(); foreach ($urls as $url) { $codes = get_cpp_codes(get_page($url)); foreach ($codes as $code) { array_push($answers, $code); } } return $answers; }