FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » First question and introducing myself
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: First question and introducing myself [message #178042 is a reply to message #178012] Fri, 11 May 2012 08:47 Go to previous messageGo to previous message
Shake is currently offline  Shake
Messages: 40
Registered: May 2012
Karma:
Member
First, Thanks, Jerry Stuckle and Denis McMahon, for your help.

Jerry, your code doesn't do what I want/need, but gave me some
interesting clues :)

Denis, I am not sure if you're code does, but I guess yes it does.

After your messages, I get this code that does just what I want:

<?
function setArrayPathValue($arrayPath, $src, & $dst)
{
foreach ($arrayPath as $index) $src = $src[$index];

// Here I could validate $src

$result2 = & $dst;
while(!empty($arrayPath))
{
$result3 = & $result2;
$index = array_shift($arrayPath);
if(!isset($result3[$index])) $result3[$index] = array();
$result2 = & $result3[$index];
}
$result3[$index] = $src;
}

$dato['ruta']['a']['un']['dato'] = 'contenido';
setArrayPathValue( array('ruta','a','un','item'), $dato, $_SESSION );

print_r($_SESSION);
?>


Thanks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Windows binaries 64bit for PHP
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 23:19:44 GMT 2024

Total time taken to generate the page: 0.04599 seconds