I'm struggling to get the specific item from the following array. I'd like to get the 2nd item from the 3rd, 10th, and 17th number array. If I've more item in the array then it will continuously find the 2nd item in a pattern.
However, I'm unable to get the 2nd item from using the above pattern and I am not getting any logic to get this.
What should I do in this case? Have you got any logic? How would you skip all the arrays and just return specific items?
Array
(
[1] => Array
(
[2] => TAB1
)
[2] => Array
(
[1] => Blah
[2] => SCRIPT DISCRIPTION: <User is trying to accomplish some goal>
[3] => Step #
[4] => STEPS
[5] => EXPECTED RESULT
[6] => PASS/FAIL
[7] => Comments
[8] => QA
[9] => Date
)
[3] => Array
(
[1] => Jim
[2] => Script 1: Login
[4] => Preconditions: (Use of hyperlink to Preconditions/Setup tab)
[6] => N/A
[8] => Beth
[9] => 7/1/2015
)
[4] => Array
(
[3] => 1
[4] => Log on to the Health view.
[6] => Pass
)
[5] => Array
(
[3] => 2
[4] => Click the Visit tab.
[6] => Pass
)
[6] => Array
(
[3] => 3
[4] => Click the Daily Log side-tab.
[5] => The Visit Log defaults to the current date. A list of any visits you have already entered for current date appears.
[6] => Fail
)
[7] => Array
(
[3] => 4
[4] => Type a student's name into the Name/ID field. For example, Aldred, Allison.
[5] => Verify the name you entered exists in the database (you can select it from the list).
[6] => Pass
)
[8] => Array
(
[3] => 5
[4] => Click Add button.
[5] => The New Health Log page appears and the Name field is prepopulated with the student's name
[6] => Fail
)
[9] => Array
(
[2] => skip
)
[10] => Array
(
[1] => Ted
[2] => Script 2: Enter a Visit for a Student on the Visit/ Daily Log page
[4] => Preconditions: (Use of hyperlink to Preconditions/Setup tab)
[8] => Tom
[9] => 7/2/2015
)
[11] => Array
(
[3] => 1
[4] => Log on to the Health view.
[6] => Blocked
)
[12] => Array
(
[3] => 2
[4] => Click the Visit tab.
)
[13] => Array
(
[3] => 3
[4] => Click the Daily Log side-tab.
[5] => The Visit Log defaults to the current date. A list of any visits you have already entered for current date appears.
)
[14] => Array
(
[3] => 4
[4] => Type a student's name into the Name/ID field. For example, Aldred, Allison.
[5] => Verify the name you entered exists in the database (you can select it from the list).
)
[15] => Array
(
[3] => 5
[4] => Click Add button.
[5] => The New Health Log page appears and the Name field is prepopulated with the student's name
)
[16] => Array
(
[2] => skip
)
[17] => Array
(
[1] => James
[2] => Script 3: Change user details
[4] => Preconditions: (Use of hyperlink to Preconditions/Setup tab)
[8] => Jen
[9] => 7/3/2015
)
[18] => Array
(
[3] => 1
[4] => Log on to the Health view.
[6] => Skip
)
[19] => Array
(
[3] => 2
[4] => Click the Visit tab.
[6] => Skip
)
[20] => Array
(
[3] => 3
[4] => Click the Daily Log side-tab.
[5] => The Visit Log defaults to the current date. A list of any visits you have already entered for current date appears.
)
[21] => Array
(
[3] => 4
[4] => Type a student's name into the Name/ID field. For example, Aldred, Allison.
[5] => Verify the name you entered exists in the database (you can select it from the list).
[6] => Pass
)
[22] => Array
(
[3] => 5
[4] => Click Add button.
[5] => The New Health Log page appears and the Name field is prepopulated with the student's name
[6] => Skip
)
)
["Script 1: Login", "Script 2: Enter...", "Script 3: Change user details"]?in_array()for this). And if it is, just get the second element into an array. If you get stuck, post the attempt here.in_array()in the manual and try something like this (pseudo code):for each element{if($key == $whitelist){get element 2}}