Can't seem to figure out how to do this one. Given a string I want to return the length of that string... simple enough, but I also want an array of 'search' strings within it to only count as one.
$string = 'this is [Enter]a test example of [Enter]something.';
//this can contain any number of different strings
$replace = array(
'[Alt]',
'[Backspace]',
'[Ctrl]',
'[Del]',
'[Down]',
'[End]',
'[Enter]'
);
expected output for the above would be :
$string = 'this is [Enter]a test example of [Enter]something.';
// would be 50
$norm_length = strlen($string);
//where all [x]'s in above array count as 1
$length = 38;