I need PHP code to replace comma or whitespace with hyphen
For eg:
If $value = 'home garden'
or $value = 'home,garden'
,
i need result as home-garden
I tried $result = preg_replace('/\s+[\,]/', '-', trim($value));
, but no use..
Can someone explain it?