answersLogoWhite

0


Best Answer

$array1 = array("Matt","Michael","Justin");
$array2 = array("Janice","Janet","Kylie");

array_splice($array1,2,0$array2);


We take $array2 and add it to $array1 at location 2 starting at the 0 position of $array2.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you splice two arrays together in PHP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Name two smaller arrays you can use to find the product of 8x6?

name two smaller arrays you can use to find the product


What do you call a number that can be arranged in more than two arrays?

composite


What also called two dimensional arrays are?

I suppose you could refer to a two-dimensional array as a rectangular or square array (or as a jagged array of not all arrays within a given dimension have the same size). Table, grid or matrix may also be good synonyms for two-dimensional array, subject to the problem domain addressed with the algorithm.


Meaing of Associative Array in PHP?

There are two types of arrays, associative arrays, and indexed arrays. Indexed arrays are where you access the items in order, for example $myArray[0] would be the first item in the array, $myArray[1] would be the second item, and so on. You can create an indexed array like this: $myArray = array("item1","item2","item3"); echo $myArray[0]; //item1 echo $myArray[2]; //item3 You can also set your own indexes: $myArray = array(0=>"item1", 1=>"item2", 5=>"number 5"); echo $myArray[0]; //item1 echo $myArray[2]; //null or doesnt exist, i cant remember You can also add items after using the square-brackets. If you include a number, that index is set, otherwise it just adds it to the end of the array. $myArray[9] = "set index 9"; $myArray[] = "add to the end of the array"; Associative arrays use strings instead of numbers. $colors = array("cat"=>"brown", "dog"=>"yellow", "fish"=>"purple"); echo $colors["cat"]; //brown echo $colors["fish"]; //purple And you can add more with the square-brackets again. $colors["camel"] = "green"; To loop through both types of arrays you can use a foreach loop, or to loop through indexed arrays you can get the length into a variable and a do normal for loop.


How many arrays can be drawn for each prime number?

Just one. Or, two if you count (1, p) and (p, 1) as being different.

Related questions

How do you get difference between two or more arrays in PHP?

The inherit function `array_dif($arrayOne, $arrayTwo, $arrayThree, ...)` is likely what you're looking for. It compares two or more arrays, and returns an array of values that are unique among the arrays.


What is electrical splice?

The joining together of two or more conductors in an electric circuit.


What is a Y- sPLICE?

A splice is usually two rope ends joined together to form a longer rope. A Y splice is three rope ends are joined together to form a Y shape. The same can be said for connecting three electrical or component cables.


How to connect two wires together?

You can solder them after using a western splice connection. You can use a mechanical butt splice and you can connect the wires together with a wire nut after twisting the wires together. All you have to remember is that the insulation of the splice has to be equal to the wire insulation or greater.


What are the Disadvantages of fiber optic cable?

It's very expensive, and difficult to splice two cables together.


What does the term - wire splice - mean?

A wire splice is the joining of two or more wires together. Commonly this is done with an approved wire joining nut. All slices are to be made in junction boxes to prevent fire should the wire splice become unserviceable.


How do get white kuyrum in Pokemon white 2?

Get Kyurem, dna splicer. trade for a reshiram and splice the two together


Given two arrays A and B Array?

distinguish extra element in two arrays


How do you find the difference between two arrays in Java?

for arrays you can list the different arrays and what attributes that you give to them.


How can you spot a comma splice?

If it is possible to replace a comma in a given sentence with a period, and wind up with two sentences that are each complete and that make sense as sentences, then the comma that you replaced was being used to splice together two sentences. This is generally a bad idea.


How do you bypass heater core on 2000 ford expedition?

just splice the two heater hoses that go through to the heater core the together


Name two smaller arrays you can use to find the product of 8x6?

name two smaller arrays you can use to find the product