{"id":1486,"date":"2021-05-06T07:47:32","date_gmt":"2021-05-06T07:47:32","guid":{"rendered":"https:\/\/phptutorial.net\/?page_id=1486"},"modified":"2025-04-07T12:44:58","modified_gmt":"2025-04-07T12:44:58","slug":"php-implode","status":"publish","type":"page","link":"https:\/\/www.phptutorial.net\/php-tutorial\/php-implode\/","title":{"rendered":"PHP implode"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you&#8217;ll learn how to use the PHP <code>implode()<\/code> function to join a list of string using a separator.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-the-php-implode-function'>Introduction to the PHP implode() function <a href=\"#introduction-to-the-php-implode-function\" class=\"anchor\" id=\"introduction-to-the-php-implode-function\" title=\"Anchor for Introduction to the PHP implode() function\">#<\/a><\/h2>\n\n\n\n<p>The PHP <code>implode()<\/code> function allows you to join an <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array\/\">array<\/a> of <a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-string\/\">strings<\/a> by a separator. Here&#8217;s the syntax of the <code>implode()<\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">implode ( string $separator , <span class=\"hljs-keyword\">array<\/span> $array ) : string<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>implode()<\/code> function has two parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>$separator<\/code> is the separator that separates between two strings. The <code>$separator<\/code> defaults to an empty string.<\/li>\n\n\n\n<li>The <code>$array<\/code> is an array of strings to join.<\/li>\n<\/ul>\n\n\n\n<p>The <code>implode()<\/code> function returns a new string resulting from joining string elements in the $array with the separator.<\/p>\n\n\n\n<p>The order of string elements in the result string is the same as the order they appear on the $array.<\/p>\n\n\n\n<p>If the array is empty, then the <code>implode()<\/code> function returns an empty string.<\/p>\n\n\n\n<p class=\"note\">Note that the <code>join()<\/code> function is the alias of the <code>implode()<\/code> function so that you can use them interchangeably.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='php-implode-function-examples'>PHP implode() function examples <a href=\"#php-implode-function-examples\" class=\"anchor\" id=\"php-implode-function-examples\" title=\"Anchor for PHP implode() function examples\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using the <code>implode()<\/code> function.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='1-using-the-implode-function-to-join-strings-example'>1) Using the implode() function to join strings example <a href=\"#1-using-the-implode-function-to-join-strings-example\" class=\"anchor\" id=\"1-using-the-implode-function-to-join-strings-example\" title=\"Anchor for 1) Using the implode() function to join strings example\">#<\/a><\/h3>\n\n\n\n<p>Suppose that you have a list of column names, including first_name, last_name, and email. And you want to turn it into a header of a CSV file.<\/p>\n\n\n\n<p>To do that, you can use the <code>implode()<\/code> function to join the string elements like this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$columns = &#91;<span class=\"hljs-string\">'first_name'<\/span>, <span class=\"hljs-string\">'last_name'<\/span>, <span class=\"hljs-string\">'email'<\/span>];\n$header = implode(<span class=\"hljs-string\">','<\/span>, $columns);\n\n<span class=\"hljs-keyword\">echo<\/span> $header;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRjb2x1bW5zID0gWydmaXJzdF9uYW1lJywgJ2xhc3RfbmFtZScsICdlbWFpbCddOwokaGVhZGVyID0gaW1wbG9kZSgnLCcsICRjb2x1bW5zKTsKCmVjaG8gJGhlYWRlcjs\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">first_name,last_name,email<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='2-using-the-implode-function-with-the-array_map-function'>2) Using the implode() function with the array_map() function <a href=\"#2-using-the-implode-function-with-the-array_map-function\" class=\"anchor\" id=\"2-using-the-implode-function-with-the-array_map-function\" title=\"Anchor for 2) Using the implode() function with the array_map() function\">#<\/a><\/h3>\n\n\n\n<p>If you want to replace the underscore (_) in each element, you can do it as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$columns = &#91;<span class=\"hljs-string\">'first_name'<\/span>, <span class=\"hljs-string\">'last_name'<\/span>, <span class=\"hljs-string\">'email'<\/span>];\n$header = implode(<span class=\"hljs-string\">','<\/span>, array_map(fn ($c) =&gt; str_replace(<span class=\"hljs-string\">'_'<\/span>, <span class=\"hljs-string\">' '<\/span>, $c), $columns));\n\n<span class=\"hljs-keyword\">echo<\/span> $header;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRjb2x1bW5zID0gWydmaXJzdF9uYW1lJywgJ2xhc3RfbmFtZScsICdlbWFpbCddOwokaGVhZGVyID0gaW1wbG9kZSgnLCcsIGFycmF5X21hcChmbiAoJGMpID0-IHN0cl9yZXBsYWNlKCdfJywgJyAnLCAkYyksICRjb2x1bW5zKSk7CgplY2hvICRoZWFkZXI7\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>How it works.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, the <code><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array_map\/\">array_map()<\/a><\/code> returns a new array with each element&#8217;s underscore string (<code>_<\/code>) replaced by the space.<\/li>\n\n\n\n<li>Second, the <code>implode()<\/code> joins the strings of the returned array of the array_map() function.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='3-using-the-implode-function-with-the-array_filter-function'>3) Using the implode() function with the array_filter() function <a href=\"#3-using-the-implode-function-with-the-array_filter-function\" class=\"anchor\" id=\"3-using-the-implode-function-with-the-array_filter-function\" title=\"Anchor for 3) Using the implode() function with the array_filter() function\">#<\/a><\/h3>\n\n\n\n<p>The following example illustrates how to use the <code>implode()<\/code> function with the <code><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array-filter\/\">array_filter()<\/a><\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$columns = &#91;<span class=\"hljs-string\">'ssn'<\/span>, <span class=\"hljs-string\">'first_name'<\/span>, <span class=\"hljs-string\">'last_name'<\/span>, <span class=\"hljs-string\">'password'<\/span>, <span class=\"hljs-string\">'email'<\/span>, <span class=\"hljs-string\">'phone'<\/span>];\n$excludes = &#91;<span class=\"hljs-string\">'ssn'<\/span>, <span class=\"hljs-string\">'password'<\/span>];\n\n$header = implode(<span class=\"hljs-string\">','<\/span>, array_filter($columns, fn ($c) =&gt; !in_array($c, $excludes)));\n\n<span class=\"hljs-keyword\">echo<\/span> $header;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRjb2x1bW5zID0gWydzc24nLCAnZmlyc3RfbmFtZScsICdsYXN0X25hbWUnLCAncGFzc3dvcmQnLCAnZW1haWwnLCAncGhvbmUnXTsKJGV4Y2x1ZGVzID0gWydzc24nLCAncGFzc3dvcmQnXTsKCiRoZWFkZXIgPSBpbXBsb2RlKCcsJywgYXJyYXlfZmlsdGVyKCRjb2x1bW5zLCBmbiAoJGMpID0-ICFpbl9hcnJheSgkYywgJGV4Y2x1ZGVzKSkpOwoKZWNobyAkaGVhZGVyOw\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">first_name,last_name,email,phone<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>How it works.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, define two arrays of strings, one for columns and the other for excluding columns.<\/li>\n\n\n\n<li>Second, use the <code><a href=\"https:\/\/phptutorial.net\/php-tutorial\/php-array-filter\/\">array_filter()<\/a><\/code> function to filter the columns in the excluded list.<\/li>\n\n\n\n<li>Third, use the <code>implode()<\/code> function to join the strings in the array returned by the <code>array_filter()<\/code> function.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='4-using-the-php-implode-function-with-an-associative-array-example'>4) Using the PHP implode() function with an associative array example <a href=\"#4-using-the-php-implode-function-with-an-associative-array-example\" class=\"anchor\" id=\"4-using-the-php-implode-function-with-an-associative-array-example\" title=\"Anchor for 4) Using the PHP implode() function with an associative array example\">#<\/a><\/h3>\n\n\n\n<p>If you pass an associative array to the <code>implode()<\/code> function, it will join the array&#8217;s values only and disregard the array keys. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n$person = &#91;\n    <span class=\"hljs-string\">'first_name'<\/span> =&gt; <span class=\"hljs-string\">'John'<\/span>,\n    <span class=\"hljs-string\">'last_name'<\/span> =&gt; <span class=\"hljs-string\">'Doe'<\/span>,\n    <span class=\"hljs-number\">25<\/span>,\n    <span class=\"hljs-string\">'Female'<\/span>\n];\n\n<span class=\"hljs-keyword\">echo<\/span> implode(<span class=\"hljs-string\">','<\/span>, $person);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCiRwZXJzb24gPSBbCiAgICAnZmlyc3RfbmFtZScgPT4gJ0pvaG4nLAogICAgJ2xhc3RfbmFtZScgPT4gJ0RvZScsCiAgICAyNSwKICAgICdGZW1hbGUnCl07CgplY2hvIGltcGxvZGUoJywnLCAkcGVyc29uKTs\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">John,Doe,<span class=\"hljs-number\">25<\/span>,Female<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='5-using-the-php-implode-function-with-an-array-that-has-one-element'>5) Using the PHP implode() function with an array that has one element <a href=\"#5-using-the-php-implode-function-with-an-array-that-has-one-element\" class=\"anchor\" id=\"5-using-the-php-implode-function-with-an-array-that-has-one-element\" title=\"Anchor for 5) Using the PHP implode() function with an array that has one element\">#<\/a><\/h3>\n\n\n\n<p>The following defines a function called <code>get_header()<\/code> that returns a comma-separated list of columns:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-function\"><span class=\"hljs-keyword\">function<\/span> <span class=\"hljs-title\">get_header<\/span><span class=\"hljs-params\">(array $columns)<\/span>: <span class=\"hljs-title\">string<\/span>\n<\/span>{\n    <span class=\"hljs-keyword\">if<\/span> (<span class=\"hljs-number\">1<\/span> === count($columns)) {\n        <span class=\"hljs-keyword\">return<\/span> $columns&#91;<span class=\"hljs-number\">0<\/span>];\n    }\n\n    <span class=\"hljs-keyword\">return<\/span> implode(<span class=\"hljs-string\">','<\/span>, $columns);\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The <code>get_header()<\/code> function returns the first element in the <code>$columns<\/code> array if the <code>$columns<\/code> array has one element. Otherwise, it returns a comma-separated list of strings in the <code>$columns<\/code> array.<\/p>\n\n\n\n<p>The following shows how to use the <code>get_header()<\/code> function:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-keyword\">echo<\/span> get_header(&#91;<span class=\"hljs-string\">'first_name'<\/span>]) . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ first_name<\/span>\n<span class=\"hljs-keyword\">echo<\/span> get_header(&#91;<span class=\"hljs-string\">'first_name'<\/span>, <span class=\"hljs-string\">'last_name'<\/span>]) . <span class=\"hljs-string\">'&lt;br&gt;'<\/span>; <span class=\"hljs-comment\">\/\/ first_name,last_name<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmZ1bmN0aW9uIGdldF9oZWFkZXIoYXJyYXkgJGNvbHVtbnMpOiBzdHJpbmcKewogICAgaWYgKDEgPT09IGNvdW50KCRjb2x1bW5zKSkgewogICAgICAgIHJldHVybiAkY29sdW1uc1swXTsKICAgIH0KCiAgICByZXR1cm4gaW1wbG9kZSgnLCcsICRjb2x1bW5zKTsKfQoKZWNobyBnZXRfaGVhZGVyKFsnZmlyc3RfbmFtZSddKSAuICc8YnI-JzsgLy8gZmlyc3RfbmFtZQplY2hvIGdldF9oZWFkZXIoWydmaXJzdF9uYW1lJywgJ2xhc3RfbmFtZSddKSAuICc8YnI-JzsgLy8gZmlyc3RfbmFtZSxsYXN0X25hbWU\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>However, the code in the <code>get_header()<\/code> is unnecessary since the <code>implode()<\/code> function already has a logic to handle the array with one element. For example:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-meta\">&lt;?php<\/span>\n\n<span class=\"hljs-keyword\">echo<\/span> implode(<span class=\"hljs-string\">','<\/span>, &#91;<span class=\"hljs-string\">'first_name'<\/span>]); <span class=\"hljs-comment\">\/\/ first_name<\/span>\n<span class=\"hljs-keyword\">echo<\/span> implode(<span class=\"hljs-string\">','<\/span>, &#91;<span class=\"hljs-string\">'first_name'<\/span>, <span class=\"hljs-string\">'last_name'<\/span>]); <span class=\"hljs-comment\">\/\/ first_name,last_name<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a href=\"https:\/\/phptutorial.net\/playground\/?q=PD9waHAKCmZ1bmN0aW9uIGdldF9oZWFkZXIoYXJyYXkgJGNvbHVtbnMpOiBzdHJpbmcKewogICAgaWYgKDEgPT09IGNvdW50KCRjb2x1bW5zKSkgewogICAgICAgIHJldHVybiAkY29sdW1uc1swXTsKICAgIH0KCiAgICByZXR1cm4gaW1wbG9kZSgnLCcsICRjb2x1bW5zKTsKfQoKZWNobyBpbXBsb2RlKCcsJywgWydmaXJzdF9uYW1lJ10pIC4gJzxicj4nOyAvLyBmaXJzdF9uYW1lCmVjaG8gaW1wbG9kZSgnLCcsIFsnZmlyc3RfbmFtZScsICdsYXN0X25hbWUnXSkgLic8YnI-JzsgLy8gZmlyc3RfbmFtZSxsYXN0X25hbWU\" target=\"_blank\" rel=\"noreferrer noopener\">Try it<\/a><\/p>\n\n\n\n<p>When the input array has one element, the <code>implode()<\/code> function doesn&#8217;t add a trailing separator, which is the comma in this example.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the PHP <code>implode()<\/code> function to join strings in an array with a separator between each element.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Did you find this tutorial useful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1486\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-implode\/\"\n\t\t\t\tdata-post-title=\"PHP implode\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1486\"\n\t\t\t\tdata-post-url=\"https:\/\/www.phptutorial.net\/php-tutorial\/php-implode\/\"\n\t\t\t\tdata-post-title=\"PHP implode\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn how to use the PHP implode() function to join array elements with a string.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":15,"menu_order":111,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1486","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/comments?post=1486"}],"version-history":[{"count":4,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1486\/revisions"}],"predecessor-version":[{"id":3251,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/1486\/revisions\/3251"}],"up":[{"embeddable":true,"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/pages\/15"}],"wp:attachment":[{"href":"https:\/\/www.phptutorial.net\/wp-json\/wp\/v2\/media?parent=1486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}