I have a function that should report a boolean, but it's adding spaces to the front of the string. Even with trim(), the spaces remain... What is causing this?
PHP
function a($v){
$r = is_file($v) ? 1 : 0;
return(trim($r));
}
JS
$.ajax(url+query,{ success:function(data){ return(data); } });
Output
1
Update
I'm invoking using $_GET
, calling the function depending on the parameter past in the query. This is the first time I've had this issue, everything else works fine. I don't think this has any thing to do with spaces in the file - it doesn't occur anywhere else, and I'm only returning what's in the function..