As it currently stands, this question is not a good fit for our Q&A format. We开发者_高级运维 expect answers to be supported by facts, references,or expertise, but this question will likely so
As it currently stands, this question is not a good fit for our Q&A format. We开发者_高级运维 expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Is there a PHP function that replaces - with _ (underscores) ?
Like
my-name
with
my_name
str_replace('-', '_', $name)
You need to use the return of str_replace!
$name = str_replace('-', '_', $name);
There's, but it's not called replace_hyphen, it's str_replace
精彩评论