Answers for "php explode in javascript"

PHP
46

php explode

$colors  = "red,blue,green,orange";
$colorsArray = explode(",", $colors);
Posted by: Guest on June-14-2019
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
2

php explode

$list = "one-two-three";
$sep_char = "-";
// array of all needed items: "one", "two", "three"
$arr = explode($sep_char, $list);
// array of max two items: "one", "two-three"
$arr = explode($sep_char, $list, 2);
Posted by: Guest on February-17-2021
0

explode in php

$stringArray = ['Name=xyz','[email protected]','Password=xyz@123','Address=xyz University Lucknow'];

$loginCredentials = [];
foreach($stringArray as $item){
    $data = explode('=', $item);

    if(in_array('Email',$data) || in_array('Password',$data)){
        $loginCredentials[$data[0]] = $data[1];
    }
}

//Output desired array
print_r($loginCredentials);
Posted by: Guest on February-04-2022

Browse Popular Code Answers by Language