Bạn có thể nhận thấy rằng đây là cùng các nhà điều hành được sử dụng để gọi một phương thức của lớp cha mẹ của đối tượng hiện tại, như cha mẹ:: phương pháp (). Việc sử dụng lớp cha mẹ là một trường hợp đặc biệt nơi thừa kế là có liên quan, như các phương pháp lớp cha mẹ giữ lại truy cập dữ liệu ví dụ của đối tượng, và do đó không phải là tĩnh. | Strings 87 Simpo PDF Merge and Split Unregistered Version - http php text EOD This will be row 1 This will be row 2 This will be row 3 This will be row 4 EOD lines explode PHP_EOL text echo table border 1 .PHP_eOl foreach lines as line echo tr .PHP_EOL. td . line. td .PHP_EOL. tr PHP_EOL echo table .PHP_EOL This script uses explode to break the text at the line feed characters and place the text into an array. The PHP_EOL constant the current operating system s end of line EOL character is used for the line feed character to make the script more portable. The array is then used to build an HTML table which you can see in Figure . This will be row 1 This will be row 2 This will be row 3 This will be row 4 Figure . Using explode to output text as a table Discussion It s useful to know that the implode function does exactly the opposite of what we ve seen here it builds a string out of an array. Let s add the following line to the above example echo implode lines PHP_EOL Here s the resulting output of our original string 88 The PHP Anthology Simpo PDF Merge and Split Unregistered Version - http This will be row 1 This will be row 2 This will be row 3 This will be row 4 How do I trim whitespace from text When we re dealing with form submissions among other tasks we often need to consider whitespace. Sometimes it s submitted by the user in error it is hard to see after all. It may also be submitted on purpose by users who want to avoid filling in fields for example. The presence of whitespace in submitted data can cause problems for your application the erroneous inclusion of whitespace could result in the storage of incorrect usernames or email addresses for instance so it s useful to be able to trim the whitespace from submitted form values. Solution The trim function is another handy PHP tool. It removes whitespace characters at the start and end of strings and works like this php string This has whitespace at both ends Remove