php - Strip hidden whitespace from string -
i have string 35 displayed characters string's length 36 due kind of whitespace @ end of string. how can rid of kind of 'hidden' character (whose hex-code representation 08
) ?
var_dump($string)
gives string(36) "2014/08/8609249656_f478108e0e_h.jpg"
hex-code of $string
: 323031342f30382f383630393234393635365f663437383130386530655f682e6a706708
hex-code of string desired (without 08
@ end). 323031342f30382f383630393234393635365f663437383130386530655f682e6a7067
i can't manually shorten string, cause strings not have 'hidden' character @ end. also, trim()
not work.
you add character trim()
's character mask:
trim($string, " \t\n\r\0\x0b\x08");
Comments
Post a Comment