Answers for "find explode home in php"

PHP
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
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