Search
 
SCRIPT & CODE EXAMPLE
 

PHP

explode comma php

$myString = "9,admin@example.com,8";
$myArray = explode(',', $myString);
print_r($myArray);
Comment

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; // *

?>

Comment

explode (PHP 4, PHP 5, PHP 7, PHP 8) explode — Split a string by a string

<?php
// Example 1
$pizza  = "piece1 piece2 piece3 piece4 piece5 piece6";
$pieces = explode(" ", $pizza);
echo $pieces[0]; // piece1
echo $pieces[1]; // piece2

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

?>
Comment

PREVIOUS NEXT
Code Example
Php :: how to get a whole number from decimal in php 
Php :: create a text file in laravel 
Php :: snap store phpstrom 
Php :: php fix array index 
Php :: send email template via php 
Php :: php artisan migrate single file 
Php :: A non well formed numeric value encountered 
Php :: laravel foreach 
Php :: ternary operator in php 
Php :: add class to body class wordpress 
Php :: delete in crud php 
Php :: get static front page 
Php :: array unique php 
Php :: laravel delete 
Php :: laravel add column migration 
Php :: File Reading Mode PHP 
Php :: php sort by associative array value 
Php :: offset codeigniter 3 
Php :: send attachment in mail php 
Php :: <a href="<?php echo base_url(); ?"somelink</a 
Php :: socialite laravel 7 
Php :: php get looping month 
Php :: How to remove updated_at or use only created_at laravel eloquent ORM 
Php :: laravel slug 
Php :: array flat php 
Php :: delete multiple row by model in laravel 
Php :: show time laravel 
Php :: pdf to html php 
Php :: How to Show the Logged in Username in the WordPress 
Php :: check the ajax request in laravel 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =