I am using plugin for wordpress,
import-users-from-csv plugin upload csv error log in text file.
i need help error log display same screen, array value display print_r();
but display in my screen error on my foreach loop.help with correct my foreach loop.
Array
(
[0] => WP_Error Object
(
[errors] => Array
(
[existing_user_login] => Array
(
[0] => Sorry, that username already exists!
)
)
[error_data] => Array
(
)
)
[1] => WP_Error Object
(
[errors] => Array
(
[existing_user_login] => Array
(
[0] => Sorry, that username already exists!
)
)
[error_data] => Array
(
)
)
)
I am using display this array value in this foreach but value not display, Help with us
foreach($nerrors as $key=>$err)
{
echo $err['errors']['existing_user_login'][$key];
}
Edited
foreach($nerrors as $err)
{
echo $err->errors['existing_user_login'][0];
}
errors are object element , not array.
Please check it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With