How do I eliminate line break from fgets function in PHP?
Use rtrim()
.
Specifically:
rtrim($var, "\r\n");
(To avoid trimming other characters, pass in just newline.)
Your best bet is to use the php trim() function. See http://php.net/manual/en/function.trim.php
$b = trim(fgets($a));