回声“n”

I'm using a Controller in AngularJS which calls http.post twice. The first one is just to get values from MySQL row , while the other is just for Updating the MySQL row. The problem is, in the 2nd http.post, the echo adds n before the variable that is supposed to be returned.

Call of 1st PHP file

$http.post("endpoints/EditProfilePage.php", data).success(function(response)
echo:
$userInfo = $userInfo->fetchAll();
echo json_encode($userInfo); 

This 1st echo gathers columns from a database.

Call of 2nd PHP file:

$http.post("endpoints/EditProfilePage2.php", data).success(function(response)
echo:
echo json_encode($username);

This 2nd echo should only return a single column/variable.

I think it's not a problem with the json_encode as I've already tried echoing a simple text.

The output is n"7@7" when I use echo json_encode($username);

while it's ntext when I use echo "text";