We can join all elements of an array and return a sting by using implode string function in PHP. Here are some examples

echo implode($ar);

The output is here


Sorry , we missed the space between words so let us add one gap between

$ar=array('Welcome','to','plus2net','php','section'); echo implode(" ",$ar);

The output is here

Welcome to plus2net php section

You can read how to create an array from a string by explode() function
Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    PHP String Functions

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2023 All rights reserved worldwide Privacy Policy Disclaimer