1
では動作しません、私はそうのような形式になります!フォーム入力配列が空の配列を作成して、空の()
<div class="clone-wrapper" data-id="education">
<div class="row cloneable" data-id="0">
<div class="col-md-6">
<div class="form-group">
<label><?php echo System::translate("Education Institution Name"); ?></label>
<input placeholder="<?php echo System::translate("ex : University"); ?>" name="education[0][institution]" type="text" class="max_len" maxlength="100" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label><?php echo System::translate("Education Degree"); ?></label>
<input placeholder="<?php echo System::translate("ex : Bachelor Degree"); ?>" name="education[0][degree]" type="text" class="max_len" maxlength="100" value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label><?php echo System::translate("Date of Enrollment"); ?></label>
<input placeholder="<?php echo System::translate("ex : January 2001"); ?>" name="education[0][year_begin]" type="text" class="monthyearpicker" autocomplete='off' value="">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label><?php echo System::translate("Date of Completion"); ?></label>
<input placeholder="<?php echo System::translate("ex : December 2004"); ?>" name="education[0][year_finish]" type="text" class="monthyearpicker" autocomplete='off' value="">
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label><?php echo System::translate("Education Note"); ?></label>
<textarea rows="6" class="form-control" name="education[0][about]"></textarea>
</div>
</div>
</div>
</div>
<div class="white-space-20"></div>
<div class="row text-right">
<div class="col-md-12">
<div class="btn btn-default btn-sm clonable-button" data-clone="education">
<i class="fa fa-plus"></i><?php echo System::translate("Add Education"); ?></div>
</div>
</div>
あなたは私がeducation[0][inputname]
のような名前の配列を使用しています見ることができるようになりました、私の問題がありますこれは値のない配列を作成しているので、入力に値を入力していないかどうかを確認することはできません。それは返します
Array
(
[0] => Array
(
[company] =>
[title] =>
[year_begin] =>
[year_finish] =>
[country] =>
[notes] =>
)
)
私は上!empty()
を使用できるように、それは空の配列を返すことができますどのように?
をあなたは '教育が必要です[0]' [について] ?あなたは単に 'education [about]'などを使うことができます。次に 'array_filter()'を使います。 – AbraCadaver
ええ、複数の同じ入力があります。 –