Forum Moderators: coopster
those that are just spaces or new lines should count as empty, but they don't, so just for the condition, I need to get rid of them
what function(s) should I use for this?
thank you very much in advance! :)
$yourvar = preg_replace("'[\n\r\s\t]'","",$yourvar);
if(empty($yourvar)) {......
That'll replace new lines, carriage returns spaces and tabs. A few other PHP string functions should do the same trick.
I've been reading the manual and found that maybe trim($yourvar) could work too, would it?
Any in the middle it would not strip. If you only need to strip them from beginning or end I'd use trim(), it's probably more efficient code ;)
"
in that case trim() should take away everything
thank you very much for your help :)