php - How can I remove this extra character from my string? -


i have string stored in array, , inserted sql database using php , pdo. when in database there =20 gets stored @ end of string rid of.

my code looks this:

$name = trim($message_item[1]); $name = addslashes($name); $so_row = "insert sales_order (name) values('$name')"; $dbmrp->exec($so_row); 

i thought trim() remove extra, doesn't seem help. can rid of using preg_replace('/\s+/','',$name), lose whitespace, including ones in middle want keep. =20 , how rid of it?

more info- $message_item array created exploding string gets read email.

trim spaces on beginning , end of string. can donovan said , remove 3 last caracter.

$name = substr($name, 0, -3); 

or replace =20 empty

str_replace('=20', '', subject) 

but think should figure out why getting string =20. solution remove it, nothing workaround.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -