php if statement not working properly -
I'm not sure why, but some empty values are still through my Whitespace can be garbled when creating data, trim it before your check . $$ Competitive- & gt; Home_name = trim ($ contestant-> home_name); $ Competitor- & gt; Minslinglegi = trim ($ contestant-> miningeckerfery); If ($ (Competitive-> Minalingekarfasi & gt; miningeckerfesi) & amp; Empty! ($ Contributor-> Home_name)) {$ fee_graph_data [$ Contest-> Home_name] = $ competitor- & gt; MinSingleCareFee; }} Return $ fee_graph_data; } $ mm_fees = graph_fees ($ competitors, $ fee_graph_data); Echo json_encode ($ mm_fees); ? & Gt; if statement Like when I resonate a Jason encoded version, some values are "keys", but there is nothing in "value". Any ideas?
function graph_fiss ($ competitors, $ fee_graph_data) {foreach ($ competitors as competitors) {if (empty ($ contestant-> minSingleCareFee)) {$ fee_graph_data [$ contestant - & gt; Home_name] = $ rival- & gt; Minsinglefi; }} Return $ fee_graph_data; } $ mm_fees = graph_fees ($ competitors, $ fee_graph_data); Echo json_encode ($ mm_fees);
Comments
Post a Comment