Skip to content
Advertisement

Tag: trim

Compare and trim binary/unicoded string to normal string?

I am using below mysql query to check which records vary from the trimmed value Above query returns binary value and trimmed value as shown below. Result of mysql query: Highlighted values in above image show that binary value vary from trimmed value. I tried below 2 things: calculating length of both binary and trimmed column but it is same

trim() leaves a single trailing and leading space

php 7.4 I believe php’s trim is malfunctioning. It removes duplicate trailing and leading spaces, but it leaves a single trailing and leading space. $str is a “comma seperated value” array. How can I get trim() to behave properly and thus get $list to become {“test”, “test”, “test”, “test”, “test”, “test”}, without manually checking and correcting the first and last

rtrim with underscore in php

I have line as ‘Delux Room_room’. I want get ‘Delux Room’ as result. I tried following codes. Following code give following result. Result ;- But i want Delux Room. Please help me. Answer That says “remove characters from the end of the string until you get to one that isn’t _, r, o or m.” Which obviously isn’t what you

Advertisement