Search
 
SCRIPT & CODE EXAMPLE
 

PHP

comment split une chaine de caratere en php


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

// Exemple 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

comment split une chaine de caratere en php


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

// Exemple 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 :: attach function in laravel 
Php :: php globals 
Php :: laravel-enum 
Php :: math functions and predefined constants php 
Php :: laravel collection first 
Php :: Calling itself a static function in php 
Php :: get data without pivot relation laravel 
Php :: global variable in laravel controller 
Php :: php explode empty string 
Php :: laravel blade array seearch select box 
Php :: use session in laravel 
Php :: rollback to previous php version in linux 
Php :: how to use wherehas in laravel 
Php :: php split by 
Php :: php method type hinting 
Php :: Securing form from possible sql injection 
Php :: laravel store blob image into database 
Php :: laravel api 
Php :: square php 
Php :: sync laravel 
Php :: add slashes to string 
Php :: catch warning php 
Php :: wp wc php out of stock product to bottom 
Php :: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar://D:/Program Files/Composer - PHP/composer.phar/src/Composer/DependencyResolver/Solver.php on line 223 
Php :: get percentage rating in laravel 
Php :: wp wc archive product page template 
Php :: scirvere su file php 
Php :: where statement multiple argument in codeigniter 
Php :: Find category name & link 
Php :: php pdo delete 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =