News you won't see in controlled mainstream media.

Who's Online Now
1 members (Russ), 11,481 guests, and 1,562 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
December
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Left Sidebar Ad
This is another custom island. This one could be used for ads. This spot is one of the best places for ads on your site to be placed. This can be enabled/disabled on a per forum basis.
Popular Topics(Views)
419,408 DOES GOD EXIST?
324,402 Please HELP!!!
Support Our Forum
Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Dec 1999
Posts: 30,868
Master Elite Member
****
Fastest Way to Remove All Empty Elements from An Array

Code
$empty_elements = array_keys($MyArray, '');
foreach ($empty_elements as $e) unset($MyArray[$e]);


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)
Joined: Dec 1999
Posts: 30,868
Master Elite Member
****
Perhaps A Faster Way To Remove All Empty Elements From An Array

This quick method will remove all empty elements from an array, but it has some caveats.

Code
$MyArray = array_filter($MyArray);


$MyArray will have all elements removed who's key equals:
  • (boolean) FALSE
  • (int) 0 (zero)
  • (float) 0.0 (zero point zero)
  • an empty string: ""
  • the string "0"
  • an array with zero elements
  • an object with zero member variables (PHP 4 only)
  • the special type NULL (including unset variables)
  • SimpleXML objects created from empty tags



The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 8.0.1