esc_url removes white space. Can I change that to using ‘-‘?

I’m using esc_url to sanitize my url. The only problem is that “my link” becomes “mylink”. I wouldreally like it to become “my-link”.

Is there a way to change this?

Related posts

Leave a Reply

1 comment