From: "Chris Ditty" on
Can anyone point me in the right direction? I know I am missing something
simple, but I can't place my hands on it.

$myCalTime = act_getCalendarDays($config, $myMonth, $myYear);

foreach($myCalTime as $calTime => $calArrayTime){
$calArray[] = $calArrayTime['day']."=>array('NULL','linked-day
".strtolower($calArrayTime['reason'])."','".$calArrayTime['day']."'),";
}

act_getCalendarDays returns this....
Array
(
[day] => Array
(
[0] => 05
[1] => 06
[2] => 26
[3] => 27
)

[reason] => Array
(
[0] => Vacation
[1] => Vacation
[2] => Vacation
[3] => Vacation
)

)


What am I missing to get this
=>array('NULL=','linked-day ',''),

to look like this
05=>array(NULL,'linked-day vacation','05'),
From: Micah Gersten on
Don't put the array definitions in quotes:
Should be either:

foreach($myCalTime as $calTime => $calArrayTime){
$calArray[$calArrayTime['day']] = array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']);

}

or

foreach($myCalTime as $calTime => $calArrayTime){
$calArray[] = array($calArrayTime['day'] => array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']));


Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Chris Ditty wrote:
> Can anyone point me in the right direction? I know I am missing something
> simple, but I can't place my hands on it.
>
> $myCalTime = act_getCalendarDays($config, $myMonth, $myYear);
>
> foreach($myCalTime as $calTime => $calArrayTime){
> $calArray[] = $calArrayTime['day']."=>array('NULL','linked-day
> ".strtolower($calArrayTime['reason'])."','".$calArrayTime['day']."'),";
> }
>
> act_getCalendarDays returns this....
> Array
> (
> [day] => Array
> (
> [0] => 05
> [1] => 06
> [2] => 26
> [3] => 27
> )
>
> [reason] => Array
> (
> [0] => Vacation
> [1] => Vacation
> [2] => Vacation
> [3] => Vacation
> )
>
> )
>
>
> What am I missing to get this
> =>array('NULL=','linked-day ',''),
>
> to look like this
> 05=>array(NULL,'linked-day vacation','05'),
>
>
From: "Chris Ditty" on
The array($calArrayTime..... is actually another string. I am mainly trying to get the values for ['day']['0'], ['reason']['0'] etc all on the same line.

Sorry for not being clearer.

>>> Micah Gersten <micah(a)onshore.com> 7/23/2008 2:50 PM >>>
Don't put the array definitions in quotes:
Should be either:

foreach($myCalTime as $calTime => $calArrayTime){
$calArray[$calArrayTime['day']] = array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']);

}

or

foreach($myCalTime as $calTime => $calArrayTime){
$calArray[] = array($calArrayTime['day'] => array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']));


Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Chris Ditty wrote:
> Can anyone point me in the right direction? I know I am missing something
> simple, but I can't place my hands on it.
>
> $myCalTime = act_getCalendarDays($config, $myMonth, $myYear);
>
> foreach($myCalTime as $calTime => $calArrayTime){
> $calArray[] = $calArrayTime['day']."=>array('NULL','linked-day
> ".strtolower($calArrayTime['reason'])."','".$calArrayTime['day']."'),";
> }
>
> act_getCalendarDays returns this....
> Array
> (
> [day] => Array
> (
> [0] => 05
> [1] => 06
> [2] => 26
> [3] => 27
> )
>
> [reason] => Array
> (
> [0] => Vacation
> [1] => Vacation
> [2] => Vacation
> [3] => Vacation
> )
>
> )
>
>
> What am I missing to get this
> =>array('NULL=','linked-day ',''),
>
> to look like this
> 05=>array(NULL,'linked-day vacation','05'),
>
>

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




MLGW now offers ONLINE BILLING!
To view your bills, receive paperless bills,
check payment status and pay online,
go to www.mlgw.com and click on the My Account link.
Enroll today!


This e-mail and any attachments represent the views and opinions
of only the sender and are not necessarily those of
Memphis Light, Gas & Water Division, and no such inference should be made.

From: Jason Norwood-Young on

On Wed, 2008-07-23 at 13:52 -0500, Chris Ditty wrote:
> Can anyone point me in the right direction? I know I am missing something
> simple, but I can't place my hands on it.
>
> $myCalTime = act_getCalendarDays($config, $myMonth, $myYear);
>
> foreach($myCalTime as $calTime => $calArrayTime){
> $calArray[] = $calArrayTime['day']."=>array('NULL','linked-day
> ".strtolower($calArrayTime['reason'])."','".$calArrayTime['day']."'),";
> }
>
> act_getCalendarDays returns this....
> Array
> (
> [day] => Array
> (
> [0] => 05
> [1] => 06
> [2] => 26
> [3] => 27
> )
>
> [reason] => Array
> (
> [0] => Vacation
> [1] => Vacation
> [2] => Vacation
> [3] => Vacation
> )
>
> )
>
>
> What am I missing to get this
> =>array('NULL=','linked-day ',''),
>
> to look like this
> 05=>array(NULL,'linked-day vacation','05'),

Your myCalTime isn't an array of arrays of arrays, like you're
suggesting in the foreach.

$calArray=array();
for($x=0;$x<sizeof($myCalTime["day"]);$x++) {
$calArray[]=$myCalTime["day"][$x]."=>array('NULL','linked-day
".strtolower($myCalTime['reason'][$x])."','".$myCalTime['day'][$x]."'),";
}

From: Micah Gersten on
I'm still confused. What do you mean by same line?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Chris Ditty wrote:
> The array($calArrayTime..... is actually another string. I am mainly trying to get the values for ['day']['0'], ['reason']['0'] etc all on the same line.
>
> Sorry for not being clearer.
>
>
>>>> Micah Gersten <micah(a)onshore.com> 7/23/2008 2:50 PM >>>
>>>>
> Don't put the array definitions in quotes:
> Should be either:
>
> foreach($myCalTime as $calTime => $calArrayTime){
> $calArray[$calArrayTime['day']] = array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']);
>
> }
>
> or
>
> foreach($myCalTime as $calTime => $calArrayTime){
> $calArray[] = array($calArrayTime['day'] => array('NULL','linked-day '.strtolower($calArrayTime['reason']),$calArrayTime['day']));
>
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Chris Ditty wrote:
>
>> Can anyone point me in the right direction? I know I am missing something
>> simple, but I can't place my hands on it.
>>
>> $myCalTime = act_getCalendarDays($config, $myMonth, $myYear);
>>
>> foreach($myCalTime as $calTime => $calArrayTime){
>> $calArray[] = $calArrayTime['day']."=>array('NULL','linked-day
>> ".strtolower($calArrayTime['reason'])."','".$calArrayTime['day']."'),";
>> }
>>
>> act_getCalendarDays returns this....
>> Array
>> (
>> [day] => Array
>> (
>> [0] => 05
>> [1] => 06
>> [2] => 26
>> [3] => 27
>> )
>>
>> [reason] => Array
>> (
>> [0] => Vacation
>> [1] => Vacation
>> [2] => Vacation
>> [3] => Vacation
>> )
>>
>> )
>>
>>
>> What am I missing to get this
>> =>array('NULL=','linked-day ',''),
>>
>> to look like this
>> 05=>array(NULL,'linked-day vacation','05'),
>>
>>
>>
>
>