PHP chop Function

You may also like...

4 Responses

  1. Aswin says:

    Hi Mishel, What is this carriage return(“\r”)?

    • Mishel Shaji says:

      The code \n (line feed) means moving one line forward. A carriage return (\r) means moving the cursor to the beginning of the line. Windows editors often use the combination of both as \r\n in text files for indicating a new line. Unix uses only the \n. 😊😊

  2. Nibu says:

    “\r” – a carriage return.
    “\0” – the NULL-byte.
    What are these things?

    • Mishel Shaji says:

      Hi Nibu, As I mentioned in the reply to Aswin’s comment, The code \n (line feed) means moving one line forward and a carriage return (\r) means moving the cursor to the beginning of the line. Windows editors often use the combination of both as \r\n in text files for indicating a new line. Unix uses only the \n. A null byte is a byte with the value zero (0x00 in hex). It is used to denote the end of a string in C.

I’d love to hear what you think about this post. Let me know in the comments.