Created
October 11, 2010 15:00
-
-
Save tmilewski/620644 to your computer and use it in GitHub Desktop.
$field_input_name always returns NULL. It doesn't get much simpler than this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# Testing without inputs | |
function _xprofile_registration_display_field( $field_input_name = 'field_1' ) { | |
$fields = array( | |
'field_1' => true, | |
'field_10' => true, | |
'field_2' => true, | |
'field_4' => true, | |
'field_6' => false | |
); | |
var_dump($field_input_name); # Prints NULL - WTF? | |
return ( array_key_exists($field_input_name, $fields) ) ? $fields[$field_input_name] : false; | |
} | |
?> |
I did mean print/echo/output.
Updated.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var_dump always returns NULL, did you mean 'prints'? http://php.net/manual/en/function.var-dump.php