If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
PHP में implode() function का use Array को String में convert करने के लिए किया जाता है।
implode ( string $separator , array $array );
implode() function दो arguments accept करता है।
string $separator | required : separator वह string है , जिसके according आप Array को String में convert करना चाहते हो। जब Array , String में convert होता है , तो यही separator Array values के बीच में आता है। ये whitespace , comma (,) , या underscore (_) कुछ भी हो सकता है।
array $array | required : वह Array variable जिसे आप String ,में convert करना चाहते हैं।
File : php_implode.php
<?php
/*string separated by comma */
echo implode(",", $array);
echo "<br>";
/*string separated by under score */
echo implode("_", $array);
?>
lastname,email,phone lastname_email_phone
? Example में <br> का use सिर्फ line break करने के लिए किया गया है।
Empty Array को implode करने पर आपको empty String ही return होगी।
Boolean Value true / True के लिए 1 return होगा।
echo implode(",", [true, True]); /*Output*/ 1,1
Boolean Value false / False के लिए empty String return होगी ।
echo implode(",", [false, False]); /*Output*/ Nothing*
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook