Your Open Source
Free YourOpenSource Softwares Online Resources and Softwares Downloads with Demo
Related Posts
Explode Function in PHP
The explode() function is used to break a string into an array.
Syntax is: explode(separator,string,limit)
The first parameter is the separator, this is required, it specifies where to break the string. The second parameter is the given string, of course, this is required. The third is the limit, this is optional, it specifies the maximum number of array elements to return.
Example:
<?php
$str = "PHP is fun!.";
print_r (explode(" ",$str));
?>
Output is:
Array
(
[0] => PHP
[1] => is
[2] => fun!.
)
Another example, this time with the third parameter:
<?php
$str = "PHP is fun!."
print_r(explode(" ", $str, 2));
?>
Output is:
Array
(
[0] => PHP
[1] => is
)
113
Aug 01 09 01:32:56
Lazywriter
|
Rating :
![]() ![]() ![]() ![]() ![]() | Tags :- String |
|
|||
Digg
Yahoo
delicious
