On 03/12/2012 06:38 AM, Lester Caine wrote:
Simon Schick wrote:
I suggest that all done with this variable before is not of interest ...
Assuming this, I'd say the following:

Right here you are creating two strings within an array within an array.

My guess is you will want to replace the $secondsGap[] with $secondsGap

> $secondsGap[] = array($gap[0] * 60, $gap[1] * 60);
Implicit initializing of an array that has the following structure:
array( array(int, int) );

OK $gap comes from the loop
foreach(self::$timeGap as $gap)
self::$timeGap is a list of pairs of numbers.

> if( isset($secondsGap[1]) ) {
Trying to get the second element .. which will never happen if you
haven't added an element before the snipped you pasted here.

> $gapName = $secondsGap[0]."to".$secondsGap[1];
> } else {
> $gapName = $secondsGap[0];
> }

I'm quite unsure what you want to do here. If you'd update the first
line as following it would always trigger the first condition:
$secondsGap = array($gap[0] * 60, $gap[1] * 60);
What this code is doing perfectly in PHP5.3 is generating the text
string to display for each time period listed in the array of pairs of
numbers ( some with a 'blank' second number and what the code returns is
a string of the format '(number1)to(number2)' or simply '(number1)' -
something fairly standard in PHP? But the nanny message says it need to
be re-writen, the question is 'How?' :(

Jim Lucas


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to