for ($textarea_value) { s/^\s+//; s/\s+\z//; s/[\x0D\x0A]+/\n/g; }