如何使用PHP向来自特定国家/地区的网站访问者显示不同的内容? [英] How can I show different content to website visitors from a specific country in PHP?

查看:125
本文介绍了如何使用PHP向来自特定国家/地区的网站访问者显示不同的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Wordpress博客上,我想在所有页面上向芬兰人展示其他内容.非常类似于 printfriendly.com 上屏幕左侧的反馈"按钮.如何使用PHP最可靠地实现这一目标?

解决方案

我的建议是使用PHP GeoIP函数基于IP确定用户位置,并基于IP提供适当的内容.

有关GeoIP的更多信息,可在此处找到.

On my Wordpress blog, I want to show additional content to people from Finland on all pages. Very much like the Feedback button at the left edge of the screen on printfriendly.com. How can I achieve this most reliably using PHP?

解决方案

My suggestion would be to use the PHP GeoIP functions to determine the users location based on IP, and serve appropriate content based on that.

More information on GeoIP can be found here.

这篇关于如何使用PHP向来自特定国家/地区的网站访问者显示不同的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆