Skip to content

Instantly share code, notes, and snippets.

@ha1t
Created August 11, 2013 06:39
Show Gist options
  • Save ha1t/6203728 to your computer and use it in GitHub Desktop.
Save ha1t/6203728 to your computer and use it in GitHub Desktop.
array_walk() to destroy the internal array pointer
<?php
echo phpversion() . PHP_EOL;
$lists = array('hoge');
array_walk($lists, 'trim');
if (current($lists) !== false) {
echo 'o';
} else {
echo 'x';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment