I write this code
echo ucwords('online/offline');
expected result : Online/Offline
result: Online/offline
How to make first letter after slash symbol become capital letter without adding spaces?
You can add delimiters
on the second paremeter of ucwords
echo ucwords('online/offline', '/');
This will result to:
Online/Offline
Documentation: http://php.net/manual/en/function.ucwords.php
The optional delimiters contains the word separator characters.
ucwords supports delimiter parameter:
echo ucwords('online/offline', '/');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With