Answers for "php array to string with separator"

PHP
1

php string parse with separator explode

<?php
// 1. örnek
$pizza  = "dilim1 dilim2 dilim3 dilim4 dilim5 dilim6";
$dilimler = explode(" ", $pizza);
echo $dilimler[0]; // dilim1
echo $dilimler[1]; // dilim2

// 2. örnek
$data = "foo:*:1023:1000::/home/foo:/bin/sh";
list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data);
echo $user; // foo
echo $pass; // *

?>
Posted by: Guest on July-27-2021
5

php implode array

$values = array_map('array_pop', $array);
$imploded = implode(',', $values);
Posted by: Guest on March-03-2020

Code answers related to "php array to string with separator"

Browse Popular Code Answers by Language