Answer Posted / puneet bhatt
explode function:-it breaks a string into array.
<?php
$str="hello world.it's a beautiful day.":
print_r(explode(" ",$str):
?>
ans-ARRAY
[0]=>hello
[1]=>world.
[2]=>it's
[3]=>a
[4]=>beautiful
[5]=>day.
implode:-returns a string from elements of an array.
<?php
$arr=array('hello','world!',beautiful,'day!');
echo implode(" ",$arr);
?>
ans-hello world! beautiful day!
| Is This Answer Correct ? | 36 Yes | 5 No |
Post New Answer View All Answers
What type of headers have to be added in the mail function to attach a file?
Can you define an argument as a reference type?
How to count a number of words in a string in php?
What is the use of return in php?
Tell me how do you define a constant?
In php how can you jump in to and out of "php mode"?
What is multidimensional array in php?
How to set cookies?
How does firefox manage cookies?
Can php replace javascript?
What is difference between base_url and site_url?
How many types of array are there in php?
Declare a new variable in php equal to the number 3;
How To Get the Uploaded File Information in the Receiving Script?
What are magic constants in php?