PHP display problem? -
For example due to an array, four values are displayed four times four times, I just want to assume a Bar display
How can I fix this problem? Note that the echo works perfectly before.
Here is the code.
if (count ($ array) == 1) {echo $ array [$ x] "a value has been entered"; } Else {echo fonts (",", $ array). "You have entered a more value;}
because $ x
Clearly, the first element of the array is not an indicator. Use the correct index or if you do not know what it is, just use it:
if (count ($ Array) == 1) {echo reset ($ array). 'One value is entered'; else {echo implode (',', $ array) 'you entered more than one value';}
to see what it really contains , May be helpful in dumping the array:
print_r ($ array);
Comments
Post a Comment