Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi,
How to sort the text_line[0] and $text_line[1]
When I explode it is : and again i have exploded using space,
How do I get the sorted values for text_line[0] and $text_line[1]Code: Select all
$lines = file('file.txt');
foreach($lines as $line)
{
$text_line=explode(":",$line);
$text=explode(" ",$text_line[0]);
sort($text);
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]