How you can remove white spaces from the beginning and/or the end of a String in PHP?
Submitted by: AdministratorThere are 4 PHP functions you can use remove white space characters from the beginning and/or the end of a string:
► trim() - Remove white space characters from the beginning and the end of a string.
► ltrim() - Remove white space characters from the beginning of a string.
► rtrim() - Remove white space characters from the end of a string.
► chop() - Same as rtrim().
White space characters are defined as:
► " " (ASCII 32 (0x20)), an ordinary space.
► " " (ASCII 9 (0x09)), a tab.
► " " (ASCII 10 (0x0A)), a new line (line feed).
► " " (ASCII 13 (0x0D)), a carriage return.
► "
Submitted by:
► trim() - Remove white space characters from the beginning and the end of a string.
► ltrim() - Remove white space characters from the beginning of a string.
► rtrim() - Remove white space characters from the end of a string.
► chop() - Same as rtrim().
White space characters are defined as:
► " " (ASCII 32 (0x20)), an ordinary space.
► " " (ASCII 9 (0x09)), a tab.
► " " (ASCII 10 (0x0A)), a new line (line feed).
► " " (ASCII 13 (0x0D)), a carriage return.
► "
Submitted by:
Read Online PHP Developer Job Interview Questions And Answers
Top PHP Developer Questions
☺ | Described PHP? |
☺ | What is PEAR in PHP? |
☺ | How you can protect special characters in Query String? |
☺ | Described session in PHP? |
☺ | Described the functionality of the function strstr and stristr? |
Top Coding/Programming Categories
☺ | Python Interview Questions. |
☺ | OOP Interview Questions. |
☺ | Software engineering Interview Questions. |
☺ | PHP Interview Questions. |
☺ | VBA (Visual Basic for Applications) Interview Questions. |