在Laravel 9中创建带有特殊字符的URL字符串

发布于 2025-02-13 02:07:57 字数 1176 浏览 0 评论 0原文

有关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 Output
https://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 Output
https://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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文