MySQL字符串替换
嘿,使用MySQL从特定列的所有行中删除开头和结尾斜杠的最有效方法是什么 之前:MySQL字符串替换,mysql,regex,replace,preg-replace,Mysql,Regex,Replace,Preg Replace,嘿,使用MySQL从特定列的所有行中删除开头和结尾斜杠的最有效方法是什么 之前: /hello/world/ foo/bar/ /something/else /one/more/* hello/world foo/bar something/else one/more/* 之后: /hello/world/ foo/bar/ /something/else /one/more/* hello/world foo/bar something/else one/more/* …或者这应该用
/hello/world/
foo/bar/
/something/else
/one/more/*
hello/world
foo/bar
something/else
one/more/*
之后:
/hello/world/
foo/bar/
/something/else
/one/more/*
hello/world
foo/bar
something/else
one/more/*
…或者这应该用PHP来完成?您可以使用来完成这项工作,但我认为最好在数据库之外使用PHP或您选择的任何编程语言来处理这项工作。您可以使用来完成这项工作,但我认为最好在数据库之外使用PHP或您选择的任何编程语言。请参阅 看 您的PHP选项:(我假设获取的行位于
$row
)
您的PHP选项:(我假设获取的行位于$row
)
不需要阵列$行['Field']=trim($row['Field'],'/');应该可以。不需要数组$行['Field']=trim($row['Field'],'/');我们应该做到这一点。