我想大写我在url传递到whatsapp api web的参数。
我有下面的href:
href="https://api.whatsapp.com/send?phone={{str_replace(' ', '',$client->telephone_number)}}&text=Hello {{ $client->name }} {{ $client->surname }}, I'm trying to send you a message"
具体来说,我希望{{ $client->name }} {{ $client->surname }}
大写,例如,如果我有{{$client->name}}
,即Mary{{$client->surname}}
Rossi我想要MARY ROSSI.
我已经上网浏览了一段时间,但是我没有找到任何关于它的东西。
有谁能帮帮我吗?
使用PHPstrtoupper()
函数将字符串转换为大写
所以把你的代码改成:
href="https://api.whatsapp.com/send?phone={{str_replace(' ', '',$client->telephone_number)}}&text=Hello {{ strtoupper($client->name) }} {{ strtoupper($client->surname) }}, I'm trying to send you a message"