But yesterday I sent a php file to a friend and he told me that there were some spaces at the end of the lines...
You can manually strip spaces at the ends of lines:
Document > Strip Trailing Spaces
You can also set Geany to do that automatically; in the current build from SVN, it will strip spaces from end of line when you press enter:
Edit > Preferences > Editor > Newline strips trailing spaces
He uses EditPlus and he can view like breaks.
Edit > Preferences > Display > Show line endings