I’m a sucker for regular expressions:
<?php
$category = 'test-category';
$category = preg_replace('/-/', ' ', $category);
$category = ucwords($category);
echo $category;
I’m a sucker for regular expressions:
<?php
$category = 'test-category';
$category = preg_replace('/-/', ' ', $category);
$category = ucwords($category);
echo $category;