Link to home
Start Free TrialLog in
Avatar of gloriaewold41
gloriaewold41

asked on

str_replace

Hi experts,

I need to split a line wich is in fact two words separated by comma and then identify the output as two words:

word1,word2

result:

$word1 = "word1";
$word2 = "word2";

Please help.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Use explode()

$line = 'blabla,whatever;
$words = explode(',',$line);

Echo $words[0];
Echo $words[1];

or
Print_r($words);
Avatar of gloriaewold41
gloriaewold41

ASKER

Thanks. Exactly what i needed.