I want to read last line which is 250 from Ehlo command. Currently it reads the first line which has 250 . Here is the current code

```
fputs($socket, "EHLO server1.aa.com\r\n"); // ehlo command

$res = fgets($socket, 1024); // read output

if (substr(trim($res), 0, 3) != "250") {

```

Please help me modify the code