fix sampleapi.php bug PHP<=5.3