473,395 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

assigning an value to array

Hi,
Here is my code I'm not able to assign value to the array.

Expand|Select|Wrap|Line Numbers
  1. foreach ($wishdets as $wishes => &$wishesarray) {
  2.     foreach ($wishesarray as $categories => &$categoriesarray) {
  3.         if (is_array($categoriesarray)) {
  4.             foreach ($categoriesarray as $keys => $vals) {
  5.                 if ($keys == 'dets' && $vals) {
  6.                     foreach ($vals as $valsarray) {
  7.                         $updatedTimeStamp[$wishes][$categories]['timestamp'] = $valsarray['timeAgo'];
  8.                     }
  9.  
  10.                 }
  11.             }
  12.         }
  13.         if (isset($categoriesarray['toLoad']) ) {
  14.             $temp[$categories] = $wishdets[$wishes][$categories];
  15.             $cat = $categories;
  16.             unset($wishesarray[$categories]);
  17.             $wishesarray[$cat] = $temp[$categories];
  18.             unset($temp);
  19.         }
  20.     }
  21. }
  22.  
following line is creating problem I'm not able to assign an value to another array value
Expand|Select|Wrap|Line Numbers
  1.             $wishesarray[$cat] = $temp[$categories];
  2.  
Jun 3 '11 #1
1 1449
dlite922
1,584 Expert 1GB
do a var_dump() on $cat and $temp.

Do you get the expected values in there?

There's nothing wrong with your syntax. Your logic could be off.


Dan
Jun 6 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Robert Oschler | last post by:
I am converting a Perl script over to "C" for a potential open source project. I need some open source "C" code that will give me the same functionality of a Perl Style associative array: ...
1
by: Steve Caliendo | last post by:
Hi, How do I set a variable to be null? I want to update a set in a database, and in some cases I would like a particular field to remain unchanged, or null. I'm building a query string based...
3
by: astro | last post by:
this must be obvious and i'm missing it............... i want to have 4 checkboxes in a groupbox - box1 value = 1, box2 = 2, box3 = 4, box4 = 8 these ctrls are not bound...I want to assign...
0
by: dd | last post by:
Hi, I have the following code and want to assign value to a 3D arrays and print it out. But it seems that the value 1 hasn't been assigned to that array. Could anyone help me out? Thank you very...
2
by: | last post by:
Hi everyone, I have a form with a combo box on it. When you select a value (a PO#) from the combo box, the bound field is the indexID of the selected PO. On the same form, I have a text box...
2
by: huzzaa | last post by:
I am trying to get the user to input 1-10 and that will select a a number from an array and place it into a variable. here is the code. do { cout << "Enter the first row...
4
jeffbroodwar
by: jeffbroodwar | last post by:
Hello, i have a problem about assigning a char value to a byte... please check the code below : ======================================================== Scenario # 1 : This code doesn't work : ...
1
by: Neil Chambers | last post by:
I'm currently using multidimensional arrays in PoSH by assigning values to index positions. I'm doing this because AFAIK there is no way to initialise an array simply with the 'number' of...
8
by: getmeidea | last post by:
Hi, I am using JDK 1.5. I have a program like this. Here i am directly assigning value to one object. It does'nt give me any compile time or run time error. In java we dont have access to any...
20
by: Shalini Bhalla | last post by:
i am not able to assign values ,can any one tell me whats wrong .... <script> function changeMySrc(nm,act) { alert("hi"+ nm ); if(act == 1) { ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.