0

Okay, I have an array that is created dependant on what data I receive back from a cURL request. I use a regex expression to grab the data I want and then place it into an array. However the data that is returned differs on every request. The problem I am facing now is in the example below. I seem the have two arrays. One containing 2 strings - which is fine. But they other is a blank/empty array.

Current structure:

array(2) { [0]=> string(1196) "
Please select your address from the list below.
Address 1
Address 2
Address 3
Address 4
Address 5
Address 6
" [1]=> string(1196) "
Different Address 1
Different Address 2
Different Address 3
Different Address 4
Different Address 5
Different Address 6
" } array(0) { }

My question is how would I go around removing/unsetting array(0) { }?

jakehallas
  • 2,456
  • 1
  • 18
  • 26

2 Answers2

0

Use the php unset function. http://php.net/manual/en/function.unset.php

unset($yourArrayName[0]); 
0

Try this unset($arrayName[2][0]);

ryanyuyu
  • 6,366
  • 10
  • 48
  • 53
Karthik Keyan
  • 424
  • 4
  • 15