You are here: Re: [PHP] Assign values in foreach-loop « PHP « IT news, forums, messages
Re: [PHP] Assign values in foreach-loop

Posted by Jordan Miller on 09/07/05 20:28

sorry,

i didn't fully answer the questions... if i understand your
multidimensional array correctly, your code should be something like:

foreach ($_SESSION['arr1'] as $key => $arr1) {
foreach ($_SESSION['arr2'] as $arr2) {
if ($arr1['id'] == $arr2['id']) {
$_SESSION['arr1'][$key]['selected'] = true;
}
} }

Jordan



On Sep 7, 2005, at 12:22 PM, Jordan Miller wrote:

>> foreach ($_SESSION['arr1'] as $arr1) {
>> foreach ($_SESSION['arr2'] as $arr2) {
>> if ($arr1['id'] == $arr2['id']) {
>> $arr1['selected'] = true;
>> }
>> } }
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация