Re: Have little enough hair as it is ...

From: Date: Mon, 12 Mar 2012 16:07:47 +0000
Subject: Re: Have little enough hair as it is ...
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-316994@lists.php.net to get a copy of this message
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]; }
[some-code] 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 http://www.cmsws.com/ http://www.cmsws.com/examples/ http://www.bendsource.com/

« previous php.general (#316994) next »