what are Implode and Explode functions?

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


Please Help Members By Posting Answers For Below Questions

How to set a page as a home page in a php based site?

518


What is the use of curl()?

629


What is 'float' property in css?

588


What is laravel php?

534


Do you know how can we check the value of a given variable is a number?

517






What are the different ways to login to a remote server? Explain the me, advantages and disadvantages?

533


What are the functions used in php?

503


What is the use of rand() in php?

603


How do you check if a variable has been set in php?

509


Tell me what is the use of isset() in php?

539


Will a comparison of an integer 12 and a string "13" work in php?

535


How long is session timeout?

528


Why php was called as personal home page?

538


Is string php function?

570


What is the use of namespace in php?

553