Question about The PHP Group PHP

1 Answer

PHP Array Question

I'm new to PHP my question is how do I create an array with PHP?

What are the uses of an array?

Appreciate the help.


Posted by on

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 50 Answers

<?php
$color = array("red", "blue", "yellow");
foreach($color as $key => $value) {
echo $key . " " . $value . "<br>";
}
?>

More info: http://www.phphelps.com/7_Creating_and_looping_array_in_PHP.shtml

Posted on Sep 10, 2008

1 Suggested Answer

6ya6ya
  • 2 Answers

SOURCE: I have freestanding Series 8 dishwasher. Lately during the filling cycle water hammer is occurring. How can this be resolved

Hi,
a 6ya expert can help you resolve that issue over the phone in a minute or two.
best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.
the service is completely free and covers almost anything you can think of (from cars to computers, handyman, and even drones).
click here to download the app (for users in the US for now) and get all the help you need.
goodluck!

Posted on Jan 02, 2017

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /var/www/proxy/.release/.core/proxy_s.php on line 367


Connect to the local server using Windows Authentication and specify
the AdventureWorks database as the database in use. To connect using
SQL Server Authentication, set values for the "UID" and "PWD"
attributes in the $connectionInfo parameter. For example:
$connectionInfo = array("UID" => $uid, "PWD" => $pwd));
$uid = "Administrator";
$pwd = "Password1";
$connectionInfo = array("UID" => $uid, "PWD" => $pwd));
*/
$uid = "Administrator";
$pwd = "Password1";
$connectionInfo = array("UID" => $uid, "PWD" => $pwd));
$serverName = "(localhost)";
$connectionInfo = array( "Database"=>"dbase");
$conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn )
{
echo "Connection established.\n";
}
else
{
echo "Connection could not be established.\n";
die( print_r( sqlsrv_errors(), true));
}
//-----------------------------------------------
// Perform operations with connection.
//-----------------------------------------------
/* Close the connection. */
sqlsrv_close( $conn);
?>

May 09, 2011 | Computers & Internet

1 Answer

Declare 2 arrays with 5 as index value of each. the user will input values to the first array(user-defined). Transfer value of the first array to the second array.Get the sum of the second...


You could do this by creating two arrays as such:
int firstArray[5]; int secondArray[5]
and then the sum variable:
int sum = 0;
then you could do a for loop to find the sum of the second array:

Feb 22, 2011 | Microsoft Visual C++ Professional Edition...

1 Answer

Need to increase the hdd size in a dell poweredge 1600sc with raid 1


You will not be able to increase the hdd size of a raid array, it's size is set. If you need more storage, you can add additional drives ( either in raid or standalone ) and use the new drive(s) for storage, but the original array will remain unchanged. The other option is to back up all of your data, install new drives and create a new array.

Feb 10, 2011 | Dell PowerEdge 1600SC Server

1 Answer

I have IBM eServer with ServeRaid-7K on board controller and have 3 SCSI 73GB hard drives configured in RAID-5 array. Hard Drives are running critically low on space and I bought 3 300GB scsi Ultra320 hard...


First, buy an external storage device, at least 80GB (although it's currently difficult to find any _smaller_ size!) and make a file-by-file, folder-by-folder, backup of your 73GB of "data".

Second, buy another external storage device, and do a Google-search for "drive image freeware".
Pick one of those applications, and do a "image" backup to this second external storage device.

Third, disconnect the 3 "old" drives, carefully label them, and set them aside.

Fourth, connect the 3 "new" drives, delete the old RAID-5 array definition,
and create a new RAID-5 array definition.

Fifth, do an "image restore" from the second external storage device to the new array.

If you have any problems, all you need to do to "back-out" is to:
* disconnect the "new" drives
* reconnect the "old" drives
* delete the "new" array definition
* redefine the "old" array definition

and you're back to the "old" configuration.

Dec 07, 2010 | IBM ServeRAID-7k Controller (71p8642) SCSI...

1 Answer

Hi guies the windows srever 2003 files in my hp ml370 is corrupt and i tried to fix the prblem by format one hard disk partition in my scasi disks array and installing win srv 2003 on it but whe i log on...


HP SmartStart CD x32
The utility to use to set up the ML370 g3 server is the SSCD (smart start cd) this is a guided installation cd that will help you set up the array, install drivers and diagnostic utilities and after that
will request the windows cd so that you can finish the installation.
instructions:
1. download SSCD from here
2. extract the zip file
3. burn the ISO image to a cd
4. boot the server to the cd
5. choose from the main menu the option "Deploy server"
6. follow the wizard

Oct 26, 2010 | HP Compaq ProLiant ML370 G3 Server

1 Answer

Hi does anyone know how to configure the drive array on a compaq ml350?


This model comes with Smart Array 5302/32 Array Controller (Standard with Array Models only) when posting, the server will display the controler mentioned before Smart Array 5302 and an option (press f8) once you have entered this section called ORCA you will have a menu to create, view or delete Raid.
Make sure you have the hdds properly connected before starting so that all hdd are recognized
Good Luck
Mikenet1214@hotmail.com

Aug 13, 2010 | HP Compaq ProLiant ML530 Server

1 Answer

Can a raid5 be expanded to include an additional disk on the dac960prl or must the raid be destroyed and re-created?


Hi,

As a rule of thumb, a raid 5 array can be expanded to include additional drives. This is done during the boot process and then going into your RAID controller setup. You would then go into the RAID configuration and add the new drive to the array. This was the simplified explanation but i think you get the idea.

Things to consider,
DO NOT remove the RAID array unless you dont care about losing data.
DO NOT try to add a smaller drive than what is currently part of the array.
When possible, the new drive should be identical to the existing drives, but I have added same size, same speed more than once and it will work.
All of the drives you want as part of the array must be on the same controller.

Hope this helps,
Brian

Jun 30, 2010 | LSI Logic Mylex AcceleRaid 150 DAC960PRL...

1 Answer

How to form an array in visual basics(Express)


samples of arrays in vb.net
1)
dim array(3) as integer

array(0)=1
array(1)=2
array(2)=3
array(3)=4

2) dim array() as integer

array=new integer(){1,2,3,4}

3) for two dimensional arrays add comma separation to the size

May 28, 2010 | Microsoft Visual Basic Enterprise Edition...

1 Answer

To merge two arrays A and B in java source code.


Do you need them to be sorted after the merge and are they already sorted? If not, then what you can do is create a temporary third array which will set the half of third array equal to the first array, and then set the set half equal to the second array. If they need to be sorted, I can help too but you need to tell me

public class ArrayMerge
{
public static int arr1[] = new int [20];
public static int arr2[] = new int [20];

public static void main()
{
setScores(arr1);
setScores(arr2);
printScores(arr1);
printScores(arr2);
printScores(merger(arr1,arr2));
}

public static void setScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
a[x]= (int)(Math.random() * 100)+1;
}
}

public static void printScores(int a[])
{
for(int x = 0; x<a.length; x++)
{
System.out.print(a[x] + " ");
}
System.out.println();
}

public static int[] merger(int a1[], int a2[])
{
int a3[] = new int [(a1.length + a2.length)];

for(int x = 0; x<a1.length; x++)
{
a3[x]=a1[x];
}

for(int x = 0; x<a2.length; x++)
{
a3[x+a2.length]=a2[x];
}
return a3;
}
}

Jan 24, 2009 | Microsoft Windows XP Professional With...

1 Answer

Programming


This sounds remarkably like a homework assignment type of question. Any C++ reference book will contain examples of this. Also, look for books about data structures which will contain not only examples of the above, but complete explanations of the concepts and uses of each.
Dan

Mar 24, 2008 | Computers & Internet

Not finding what you are looking for?
The PHP Group PHP Logo

Related Topics:

290 people viewed this question

Ask a Question

Usually answered in minutes!

Top The PHP Group Computers & Internet Experts

dhnguyen

Level 2 Expert

281 Answers

Computer Links

Level 3 Expert

2385 Answers

Mike

Level 3 Expert

4336 Answers

Are you a The PHP Group Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...