Answers for "php explode get separator"

PHP
8

explode comma php

$myString = "9,[email protected],8";
$myArray = explode(',', $myString);
print_r($myArray);
Posted by: Guest on April-17-2020
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

Browse Popular Code Answers by Language