what are Implode and Explode functions?

Answer Posted / suraj raut paul

Implode()
this just concatenate the variables and placed into one single variable for example
<form action=<?php $_php_self; ?> method="post">
<label for="dob">Enter Your date of Birth</label>

<select name="day">Day</option>
<option value="1">sun</option>
<option value="2">mon</option>
</select>
<select value="month">Month
<option value="1">Jan</option>
<option value="2">feb</option>
</select>

<select name="year">year
<option value="2012">2012</option>
<option value="2011">2011</option>
</select>

when sending this value in database in single field then you need to join all the values in single variable that is
$dob= implode(array($_post['day'], $_post['month', $_post['year']));

Then it's just concatenated all these values come from the from into single variable $dob.

Explode()
this is the function that is just reverse of the implode.
that it's just split the value given in one varible into array.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why php is used?

601


Tell me how comfortable are you with writing html entirely by hand?

501


What’s the special meaning of __sleep and __wakeup?

557


What are form input html tags?

549


What difference between require() and require_once()?

548






What is php written in?

533


What is a composer?

521


What is static in php?

529


"mysql_fetch_row — Get a result row as an enumerated array",this sentence comes from the PHP offical manual.However ,i can not understand the words "enumerated array".I need some help.Thanks a lot to everyone that reply.

1519


How to remove leading and trailing spaces from user input values?

537


What is csrf token in php?

544


write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.

1545


What is the default session out time?

542


Tell me how can I display text with a php script?

511


Explain me is it possible to destroy a cookie?

548