如何将PHP文件中的数字传递给Android TextView?

I have a PHP file that counts the total amount of rows in a database and outputs 382.

include('connect.php');

$counter = mysql_query("SELECT COUNT(*) AS id FROM records");
$num = mysql_fetch_array($counter);
$count = $num["id"];
echo("$count");

I want to pass that number 382 into a textview in my android activity.

Return that value in JSON format using json_encode($array) and then download it by your Android application, here you have a tutorial : http://www.vogella.com/articles/AndroidJSON/

Example :

$returning = array("Object" => "Value", [...]);
echo json_encode($returning);