An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

e.g.

<?php

$a_1d_array = array(1,2,3,4,5,6,7,8,9,10

?>

A 1 dimensional array is like a table (excel or DB).

e.g.

<?php

$a_2d_array = array(

array(1,2,3,4,5,6,7,8,9,10

array(2,4,6,8,10,12,14,16,

);

?>

A function like mysql_fetch_arry() will get 1 row of a result set from a query and return it as a 1d array.

If you wanted to add this 1d array to an array of rows (effectively cloning the result set), then you would use code like ...

$a_my_2d_array[] = $a_db_row;

This says, simplistically, add the $a_db_row as a new element to the $a_my_2s_array variable.

This constructs an 2d array primarily sorted by rows from the DB.

Remember DBs do NOT use arrays (normally). You need to talk in terms of rows.

A PHP variable can be multi-dimensional. Though I think upon reflection PHP actually uses nested 1d arrays (an element in an array can be an array).

e.g.

<?php

$a_many_array = array

(

array

(

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

),

array

(

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

),

array

(

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

),

array

(

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

),

array

(

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

),

array(1,2,3),

array(2,3,4),

array(5,6,7),

array(1,2,3),

);

?>

You don't have to populate the entire matrix either. Spare arrays are the norm with PHP.

What else do you want to know?