var.replace is not a function

My guess is that the code that’s calling your trim function is not actually passing a string to it.

To fix this, you can make str a string, like this: str.toString().replace(...)
…as alper pointed out below.

Leave a Comment

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