PHP Implode() Function24 Mar 2025 | 2 min read PHP implode() is a string function, which joins the array elements in a string. It is a binary-safe function. In implode() function, parameters can be passed in any order. The implode() function works same as the join() function and returns a string created from the elements of the array. Basically, this function joins all elements of array in one string. SyntaxThere are two syntax are available for implode() function, which are given below: or Join the array elements by $glue string parameter. ParametersThere are two parameters can be passed in the implode() function, one of which is mandatory, and another one is optional. These parameters are as follows: $glue (optional): It is an optional and string type of parameter. It contains the value to join the array elements and form a string. Basically, $glue is used to join the string. $pieces (mandatory): This parameter contains the array of string to implode. The array elements are mandatory to pass in implode() function to join into one string. Return ValueThe implode() function returns the string formed from the array elements. The string will be formed in the same order as elements passed into array. The return type of this function is string. ChangesAfter PHP version 7.4.0, passing the $glue parameter after the $pieces parameter has been deprecated. ExamplesExample 1: In the below example, array elements are joined with + operator using implode() function. Output: Before using 'implode()' function: array('Welcome', 'to', 'PHP', 'tutorial') After using 'implode()' function: Welcome+to+PHP+tutorial Example 2: Output: Noida, Delhi, Gurugram NoidaDelhiGurugram Example 3: In the below example, two arrays are joined together using implode() function. Output: Hello everyone! / Welcome to Javatpoint Next TopicPHP String |
PHP string function The is in-built PHP function. It is used to perform the ROT12 encoding on string. This function encodes shifts every letter 13 place in the alphabet while numeric and non0alphabeticall characters remains untouched. Note: This function encodes or decodes the data by same function. Syntax: str_rot13(string); Parameter Description Required/Optional String Specify...
1 min read
PHP String Function The function is a built-in function of PHP, which converts a quoted-printable string to an 8-bit string. This function returns back an 8-bit binary string. The function is similar to the imap_qprint() function and opposite to the quoted_printable_encode() function. The syntax...
1 min read
PHP String function PHP is an in-built function of PHP, which is similar to the C function. It is used to tokenize or split a string into small parts of string on the basis of given delimiters. It takes input string as an argument...
2 min read
PHP Function The is predefine string function of PHP. It is used to compare two strings. This function is binary-safe, case-sensitive and similar to strcmp() function but strcmp() have no the length parameter. The strncmp () function is often used in programming and web development...
1 min read
PHP Function PHP is string function. It is used to convert HTML entities to characters. The string function is the opposite of htmlentities(). Syntax: html_entity_decode(string,flags,character-set) Parameter Description Required/Optional string Specify the string to decode required flags Specify how to handle quotes and which document type to use. Optional Example 1 <?php $str = '<a href="https://www.javatpoint.com/">JavaTpoint.com</a>'; echo html_entity_decode($str); ?> Output: JavaTpoint.com Example 2 <?php print_r...
1 min read
PHP Function PHP function is important string function, which is used to calculate the crc32( cyclic redundancy checksum ) polynomial of a string. It can be used to validate data integrity. Note : you are using function then, you must have to use %u formatter...
1 min read
PHP explode() is a string function, which splits a string by a string. In simple words, we can say that it breaks a string into an array. The explode() function has a "separator" parameter, which cannot contain an empty string, because it holds the original...
3 min read
PHP string function The is an in-built function of PHP, which is used to add a backslash before some meta characters in the string. It returns the string by adding the backslash before every meta characters. It avoids SQL injections attacks of our database. The...
2 min read
PHP String Function The string function is an in-built function of PHP. It is used to wrap a string to the given number of characters using a string break character. PHP 4.0.2 and above versions support this function. In simple words, it wraps a string...
3 min read
PHP string lcfirst() Function The lcfirst() is in-built PHP string function. It is used to convert the first character of a string to lowercase. In another words we can say that it make a string's first character lowercase. It returns the converted string. Following are the related functions. ucfirst()...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India