I've tried many ways and searched for other approaches, but am stumped other than the brute force approach on this one.
I have a string variable coming out of a PLC (industrial control processor) that uses \00 as a filler character. That gets stored in MSSQL2000. That is not a problem but when I want to display it, I would like to take everything off the end of the actual name so it looks right.
ex.
GILSONITE\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
The problem I'm having is \ is a php identifier and using it in a str_replace causes problems. I can take the 00's out and leave the slashes then run up to 7 stripslashes to chop them off but I have 6 variables to work with and that would be silly coding IMO.
Any other suggestions? Or, should I look into mssql and see if I can do the formatting there?
I have a string variable coming out of a PLC (industrial control processor) that uses \00 as a filler character. That gets stored in MSSQL2000. That is not a problem but when I want to display it, I would like to take everything off the end of the actual name so it looks right.
ex.
GILSONITE\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00
The problem I'm having is \ is a php identifier and using it in a str_replace causes problems. I can take the 00's out and leave the slashes then run up to 7 stripslashes to chop them off but I have 6 variables to work with and that would be silly coding IMO.
Any other suggestions? Or, should I look into mssql and see if I can do the formatting there?