Problems with explode [closed]

It’s because you’ve created an array with explode and assigned it to $string, then you’re appending strings onto it when you use the .= concatenation operator within your foreach loop.

here’s a simpler method:

$string = '-' . implode( ',-', explode( ' ', $data['exclude_categories'] ) );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)