В настоящее время у меня есть строка со специальными символами и пробелами.Поэтому я хочу сделать первый символ в верхнем регистре строки только после каждого тире.
$theString = """
\r\n
\r\n
fraud - conspiracy to defraud - breach of trust - whether claims proven - locus standi - breach of\r\n
fiduciary duty and equitable fraud - prima facie case - limitation and laches - quantum and costs -\r\n
whether appellate intervention warranted\r\n
</i>\r\n
</p>\r\n
</CATCHWORDS>
"""
Я пытался
$result = ucfirst($theString);
echo $result;
//result:
"""
\r\n
\r\n
fraud - conspiracy to defraud - breach of trust - whether claims proven - locus standi - breach of\r\n
fiduciary duty and equitable fraud - prima facie case - limitation and laches - quantum and costs -\r\n
whether appellate intervention warranted\r\n
</i>\r\n
</p>\r\n
</CATCHWORDS> """
?>
Ожидаемое:
"""
\r\n
\r\n
Fraud - Conspiracy to defraud - Breach of trust - Whether claims proven - Locus standi - Breach of\r\n
fiduciary duty and equitable fraud - Prima facie case - Limitation and laches - Quantum and costs -\r\n
Whether appellate intervention warranted\r\n
</i>\r\n
</p>\r\n
</CATCHWORDS>
"""