how can I pass an array to string

0

I have a question about how to pass a string arrangement since I will use it later my arrangement is

  

$ fix [$ c1];   has N amount of data

what I want is to save it in a variable to later use it

    
asked by citlalli 02.11.2018 в 22:29
source

1 answer

0

Suppose you have this array:

  $arr = array('Hello','World!','Beautiful','Day!');

Using implode, you can pass it to a string, in this case it arms a single string with the data of the array separated by a vacuum:

<!DOCTYPE html>
<html>
<body>

<?php
    $arr = array('Hello','World!','Beautiful','Day!');
    $datos =  implode(" ",$arr);
    echo $datos;
?>

 </body>
</html>

Result:

Hello World! Beautiful Day!

    
answered by 02.11.2018 в 22:32