Tools, FAQ, Tutorials:
Joining Multiple Strings in PHP
How To Join Multiple Strings into a Single String?
✍: FYIcenter.com
If you multiple strings stored in an array, you can join them together into a single string with a given delimiter by using the implode() function. Here is a PHP script on how to use implode():
<?php $date = array('01', '01', '2006'); $keys = array('php', 'string', 'function'); print("A formated date: ".implode("/",$date)."\n"); print("A keyword list: ".implode(", ",$keys)."\n"); ?>
This script will print:
A formated date: 01/01/2006 A keyword list: php, string, function
2016-10-13, 766👍, 0💬
Popular Posts:
Where to find tutorials on API Management Services at Azure Portal? Here is a list of tutorials to a...
How to create a new API on the Publisher Dashboard of an Azure API Management Service? If you are ne...
What is EPUB 2.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 2.0 Metadata "dc:publisher" ...
How to detect errors occurred in the json_decode() call? You can use the following two functions to ...
How to Create a New Instance of a Class? There are two ways to create a new instance (object) of a c...