I am comparing a string to check if a user already exist's , im doing it with ajax and i was sending an echo to compare it. and my comparison was always false and i was going crazy until i saw that BUG (don't know what to call that). Can someone explain me why this happens in php scripts?
Asked
Active
Viewed 63 times
0

Xorifelse
- 7,878
- 1
- 27
- 38

Romeu Temudo
- 13
- 2
-
1Why don't you use json_encode instead – ßiansor Å. Ålmerol Mar 27 '17 at 15:30
-
i think i dont need that in this case , i just want to send a message if the username exists , if not i continue. but my question is : why blank spaces after or before "php scripts" send empty values. – Romeu Temudo Mar 27 '17 at 16:01
1 Answers
0
It's common practice in pure php scripts to omit closing tag, thats to avoid an infinite list of problems with invisible characters in the response.
Its even recommended in the php manual
You can find more infos, some also related to ajax call/response, in this stackoverflow question.