in my case , i need to return value from a ajax page. as i know , there is two way to do it: echo , return.
echo 0;
exit;
or
return 0;
exit;
is there any different between them?
If I were you, I would use :
echo '0';
exit();
Why ? Because you don't want to output an integer (treated as bool in PHP, I assume 0/1). You want a string so AJAX can read it.
Return is for function and stuff, not to end a page.
echo false, however, nothing shows up in the output. Still, I suppose it is safest to always echo as a string to ensure that extra data isn't truncated, like echo 1.0, which would just echo '1' and leave off the '.0'.echo '0'; even if the output is the same;