Maximum and minimum value
Posted: Fri Jul 27, 2007 3:59 am
feyd | Please use
This method I am not able to get the array sum.....
How to get the numerical value of numbers from strings
When I explode the line it is in string format.... I should find the array_sum and max() which I values are in numeric not string
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]
Hi,
I want to find the maximum and minimum, average value from the text fileCode: Select all
<?
$lines = file('./data.txt');
foreach ($lines as $line) {
$text_line = explode(":" , $line);
$text_line1 = explode(" " , $text_line[2]);
array_sum($text_line1);
}
?>How to get the numerical value of numbers from strings
When I explode the line it is in string format.... I should find the array_sum and max() which I values are in numeric not string
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]