473,656 Members | 2,776 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I create a new line in an index of an array?

JnrJnr
88 New Member
Hi all.
Here is the array that I use...
Expand|Select|Wrap|Line Numbers
  1. arrValue[0] = "Hi how you. Im fine! Thats good";
  2. arrValue[1] = "blah blah blah";
  3. arrValue[2] = "etc etc";
So if I call my arrValue[] like this...
Expand|Select|Wrap|Line Numbers
  1. for($i = 0; $i < arrValue's Size; $i ++)
  2. { echo arrValue[$i]; }
I want my array at index 0 to output like this...
Hi how you
Im fine!
Thats good

Is it possible like this
Anyone have any ideas? please
Jul 17 '11 #1
2 1349
johny10151981
1,059 Top Contributor
any ideas?

humm, anyway.

count function will return the length of the array.

also can browse array with foreach function
example:
Expand|Select|Wrap|Line Numbers
  1. $t['country']='Bangladesh';
  2. $t['capital']='Dhaka';
  3.  
  4. foreach ($t as $key=>$value)
  5. {
  6.  echo  $key." is ".$value."<br>"; 
  7. }
  8.  
Jul 17 '11 #2
JnrJnr
88 New Member
@johny10151981
Thanks for your reply I appreciate the help.
The foreach will work even better for me.
Jul 18 '11 #3

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

Similar topics

0
369
by: LaidBackWebSage | last post by:
Hi, All! I've got a very large table (149 fields -- I know, I didn't create it, and I'm working on changing it...) and I need to add an index to speed up a join query. However, when I run the "create index `index_name` on table(`column`)", MySQL uses every available connection to attempt the creation of the index, and does not allow the web site to access the database.
7
5587
by: Ross Hamilton | last post by:
I have a Report that creates a Catalogue of Products we sell under various Headings eg: Books, Recordings, Health Food, Diet Foods, etc There are 82 Headings and a total of 6000+ products which makes a big Catalogue. A Printed version of the Catalogue is done every 2 Months and we manually create an Index which takes HOURS, the problem is the Catalogue page numbers change depending on New or Deleted product ranges.
11
30958
by: Angus Comber | last post by:
Hello I want to create a lookup table where I can store string keys: For example: 192.168.0.1 -> Purple 192.168.0.2 -> Blue 192.168.0.3 -> Red
1
2057
by: Hal Styli | last post by:
hello, can someone please help... Im interested in the use of an auxiliary array to act like pointers for another array, allowing the sort order to be traversed. See code below. I dont have an application in mind, its more academic at this stage - but not a homework question!
6
24585
by: Christian Blackburn | last post by:
Hi Gang, I can't seem to figure out how to create an object array in VB.NET 2003. In VB6 you would just select an object copy and paste it and that was that. I don't know why in the heck they decided to change that. I thought it was great. I assume a 2002 answer would work in 2003 as well. Can somebody tell me how to create an object array or point me to an MSDN article regarding it? Thanks, Christian Blackburn
2
35121
by: Shirley | last post by:
We are running DB2 on iSeries V5R2. Using AQUA DATA STUDIO with a connection to our iSeries, I created a view using SQL and I am trying to create an index on this view using the code below. CREATE INDEX reports.Ivendorname ON reports.transbyvendor05 (vendorname) However I get the following error:
3
2429
by: Vayse | last post by:
I have a report which has several sub reports. Each sub report starts on its own page, and may be 2 or 3 pages long. I'd like to create an index on the first page of the main report. Something like: Clients..............p1 Sales................p3 Salesmen.........p4
23
7395
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these in an array. The application compiles but aborts without giving me any useful information. What I suspect is happening is infinite recursion. Each Directory object creates an array of Subdirectories each of which has an array of...
0
1364
by: hedonist123 | last post by:
Hi, I have a table with close to 30 lakh records. Now I wish to create an index on one of the columns. Earlier when I had tried to create an index on another column on the same table, the query ran for more than 24 hours. I cannot afford to give that much down time. Could you tell me a way to create this index at a faster speed? Thanks,
6
4315
by: Alvin SIU | last post by:
Hi all, I have a table in Db2 v8 like this: Team Name Role ------ -------- --------------------- A Superman Leader A Batman Member A WonderWoman Member B Alvin Leader
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8498
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8600
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.