Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

explode in php

$stringArray = ['Name=xyz','Email=xyz43@gmail.com','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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #explode #php
ADD COMMENT
Topic
Name
5+2 =