Ben bir bağlama, farklı bir form öğeler için bir sayfada birden çok kez, ben bir error_array anahtar var SADECE bir form öğesi içine css div sınıf eklemek değilim, bu ben bunu bir hata olan bir form öğesini vurgulamak nasıl.
Works, great if I have an error because then my error array is set, problem is before an error is set, it tries to look for an array key that does not exist. I was thinking using php's isset function first would be the ticket but I guess you cannot combine isset with another function?
<?php
//this works
$search_array = array('first' => 1, 'second' => 4);
if (array_key_exists('first', $search_array)){
echo "good";
}
// this does not work, will give write errors
$search_array = array('first' => 1, 'second' => 4);
if (isset(array_key_exists('first', $search_array))){
echo "good";
}
// Here is 1 example how I need to make the end result work
$country_class = (array_key_exists('country', $signup_errors)) ? ' signup_error' : ' signup_good';
echo '<select name="country" id="country" class="textarealong ' .$country_class. '"/>';
?>
Diğer bölgelerinde bu gibi kullanın
<?PHP echo(array_key_exists('password', $signup_errors)) ? ' signup_error' : ' signup_good';?>
Ve ben bir 1 satır kod olması olması gerekir eğer mümkünse