Answers for "explode by new line php"

PHP
2

php explode new line

$values = preg_split('/\r\n|\r|\n/', $myString);
Posted by: Guest on February-06-2021
2

explode example in php

$str = "Hello, kinjal, how, are, you";

    // it will convert string to array
    $s1 = explode(",", $str);
    echo "<pre>";
    print_r($s1);
Posted by: Guest on September-29-2021
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
0

explode in php

<?php
$str = "Hello world. It's a beautiful day.";
$split = explode(" ",$str);
$hello = $split[0];
$world = $split[1];
?>
Posted by: Guest on August-13-2021

Browse Popular Code Answers by Language