Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Getting rid of white space in an array

$
0
0

Hi,

 

I'm doing some web scraping and at the end I end up with an array.

$list[] = array('link' => $link, 'types' => $types);

Sometimes name is empty so I end up with an array like this:

Array
(
    [0] => Array
        (
            [link] => 
            [types] => Array
                (
                )

        )

    [1] => Array
        (
            [link] => 
            [types] => Array
                (
                )

       )
    [2] => Array
        (
            [link] => http://example.com
            [types] => Array
                (
                )

        )
)

Is there any way I'd be able to get rid of all the  values that are empty and so each new link starts at key 0?

 

Thanks


Viewing all articles
Browse latest Browse all 13200