Equivalent code in Python to PHP -
i need equivalent code python code in php. val
string containing 2 words seperated "-" , code separate them 2 different strings
here python code:
def function(val) : s= false ar = "" = "" x in val : if s == true : x.append(so) elif x <> "-" : x.append(ar) elif x == "-" : s= true
$result = explode('-', $val);
$result contains array of strings, split @ hyphen, i.e. $result[0], etc
Comments
Post a Comment