Friday, 27 November 2015

33_php_explode_function

PHP explode() function


filesize() contain the argument as a file name. This will give us the exact size of our file. Using fread() function we are going to read the data.



PHP contain one function named explode(), which contain argument
1st:- “,” , ”. ” , “/” etc … context which you want to remove from the word.
2nd:- file name from which file you want to remove the 1st argument value


check it out the code below.


explode() function return the data in the form of ARRAY. So either use foreach () loop to display data one by one or use print_r() function() of PHP.



Above example is display data using print_r() function of PHP.



you can see in above example display data using foreach loop. You are allowed to use $name_return_array[0] as well to display data based on key value.



No comments:

Post a Comment