Warning in code - Help appreciated

by 2 replies
3
This is the warning:

Warning: trim() expects parameter 1 to be string, array given in "file"on line 152

This is Line 152:

$selected = ( trim( $option ) == trim( $submitted_value ) || ( $is_multiselect && in_array( trim( $option ), $submitted_value ) ) ) ? 'selected="selected"' : '';

I'd appreciate any help, Thanks.
#programming #appreciated #code #warning
  • $option or $submitted_value is an array rather then a string value. You may want to just try dumping those variables and seeing what the issue is.
    • [1] reply
    • Thanks Xorb,

      Couldn't figure it out. Looks like the Multiple Selection Box has an issue. Made a new form without it. Will just have to do.

      I appreciate the help.

Next Topics on Trending Feed