在Laravel 9中创建带有特殊字符的URL字符串
有关Google Maps URL语法的信息,请参见此处如何使用特定经度和纬度链接到Google地图?创建基于纬度和经度的直接链接。 URL必须同时包含/
和@
符号。
我的Laravel刀片代码< a href =“ https://www.google.com/maps/search/?api=1& amp;query= {{{$ country-> lat}} }/@{{{$ country-> lat}},{{$ country-> long}},5z” target =“ _空白”>
我所需的输出https://www.google.com/maps/search/33.93911000,67.70995300/@33.933.9391000,67.70995300,5z
我有3个问题,但我怀疑它们是否相关。
/
正在制作URL,但已更新和编码为%2F
@
的行为奇怪,但是@@ 将显示一个
@
- 刀片变量在屏幕上打印而无法解释。
我的实际输出https://www.google.com/maps/search/?api=1&query=33.933.933.9391000,67.70995300/@ {{{$ country-&gt; lat; lat; lat; lat; lat}},67.70995300,5z </
code显示这两个符号,并显示解释的变量?
Information about Google Maps URL syntax is given here How do I link to Google Maps with a particular longitude and latitude? to create a direct link based on Latitude and Longitude. The URL must contain both /
and @
symbols.
My Laravel Blade code<a href="https://www.google.com/maps/search/?api=1&query={{ $country->lat }},{{ $country->long }}/@{{ $country->lat }},{{ $country->long }},5z" target="_blank">
My Desired Outputhttps://www.google.com/maps/search/33.93911000,67.70995300/@33.93911000,67.70995300,5z
I have 3 problems, but I suspect that they are related.
- The
/
is making the URL, but gets updated and encoded as%2F
- The
@
is acting strangely, but@@
will display a single@
- The blade variable is printing on screen and failing to be interpreted.
My Actual Outputhttps://www.google.com/maps/search/?api=1&query=33.93911000,67.70995300/@{{ $country->lat}},67.70995300,5z
How do I display these two symbols as-is and display the interpreted variable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论