php if statement not working properly -


I'm not sure why, but some empty values ​​are still through my 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);    

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;

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -