php explode() delimiter issue
- by mumis2012
I am new to php so this may be a simple fix.
I have a text file named 'textt.txt' that looks like this:
South East asia,2222,code1
winter break,3333,code2
my php code looks like this:
<?php
$x = file_get_contents('textt.txt');
$y = explode("\r\n", $x);
$z = $y[0];
echo $z;
?>
the outcome of this is: South East asia,2222,code1
I would like it to return only: South East Asia.
How can I make this happen?
Thanks!