![]() Once you start building your own PHP apps, you’ll find other uses for it as well. The PHP explode() function is very handy when dealing with user input – splitting names into first, middle, and last names at the space, or for processing saved files – for example, CSV files from spreadsheet software. If $delimiter does not appear in $string and $limit is negative, an empty array will be returned.$split_names = explode(" ", $full_name, -3) If $delimiter does not appear in the $string, an array containing a single value – the entire original $string – is returned Syntax Use explode () in one of the following syntax variants with delimiter being the separator string.If $delimiter is any empty string ( “”), explode() will return FALSE rather than an array. ![]() The result, which we have stored as $split_names, is a PHP array.The $delimiter has disappeared from the result – once used to determine the boundaries to split the string along, the delimiters are discarded. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |