473,325 Members | 2,480 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,325 software developers and data experts.

Error in Php Array

232 100+
plz help as my code is not running. its not printing array

[PHP]<?php
$i=1;
$j=0;
$pidarray=array();
while($i<10)
{
$pidarray[$j]=$i;
$i++;
$j++;
}
print_r($pidarray[$j]);
?>[/PHP]
i think its correct formate
as i received 3 warnings
Oct 24 '08 #1
5 1576
chelvan
90
hi
do u wish to print the numbers from 1 - 9. if so move your print statement in to your loop.

hope that will work.

regards
chel-1
Oct 24 '08 #2
kkshansid
232 100+
hi
do u wish to print the numbers from 1 - 9. if so move your print statement in to your loop.

hope that will work.

regards
chel-1
no its not working niether inside loop nor outside
print_r prints whole array
it should work outside loop also.it should print no from 1-9 with array index
Oct 24 '08 #3
kkshansid
232 100+
plz help as my code is not running. its not printing array

[PHP]<?php
$i=1;
$j=0;
$pidarray=array();
while($i<10)
{
$pidarray[$j]=$i;
$i++;
$j++;
}
print_r($pidarray[$j]);
?>[/PHP]
i think its correct formate
as i received 3 warnings
answered by myself it should be
print_r($pidarray)
Oct 24 '08 #4
chelvan
90
hi
just change your print statement like this, on out of the loop

Expand|Select|Wrap|Line Numbers
  1. print_r($pidarray);
  2.  
hope this time it will work

chel-1
Oct 24 '08 #5
ak1dnar
1,584 Expert 1GB
Thread title changed from "error" to "Error in Php Array".

Please Use a Good Thread Title
Using a good, clear thread title is important. The reasons for this are
Oct 24 '08 #6

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

Similar topics

4
by: Keiron Waites | last post by:
I get the following error: Notice: Array to string conversion in C:\Documents and Settings\ShepMode\Desktop\Websites\ShareMonkey.net\Web\join.php on line 11 in this code: $input =...
2
by: Sonoman | last post by:
Hi all: I am getting a "missing storage class or idetifier" error and I do not understand what it means, therefore and I cannot figure it out. I am just starting a new project and I cannot get...
3
by: Victor | last post by:
I'm trying to run this java program, but somehow the program always quit w/o giving any error msg at all. it happenned inside the first case statements. Strangely, after printing happen2, it just...
0
by: HKSHK | last post by:
This list compares the error codes used in VB.NET 2003 with those used in VB6. Error Codes: ============ 3: This Error number is obsolete and no longer used. (Formerly: Return without GoSub)...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
11
by: Andrew Poelstra | last post by:
I hammered this out this morning to fix inconsistancies with the way my programs handle errors. The code itself is fine, in that it compiles with Richard Heathfield's gcc tags (plus -c because it...
9
by: Gary Wessle | last post by:
Hi I am trying to understand how pthread is used, so I make the scenario below, I could not understand the erros by reading the man pthread_create. //**************** code start...
9
by: Trent | last post by:
Here is the error while using Visual Studio 2005 Error 1 error LNK2019: unresolved external symbol "void __cdecl print(int,int,int,int,int,int,int,int)" (?print@@YAXHHHHHHHH@Z) referenced in...
5
by: Al G | last post by:
Hi, I'm converting a bit of POP3 VB6 code to VB2005, and have run into this error with the following code. Can someone help me find out what I'm missing/doing wrong? 'holds the attachments...
2
Dormilich
by: Dormilich | last post by:
Hi, I'm testing my classes for a web page and I stumble upon an error I don't have a clue what it means: Error: Fatal error: Can't use method return value in write context in "output.php" on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.