简体   繁体   English

如何打开PHP套接字到一些URL? (例如www.ex.com:8080/mySock/)

[英]How to open PHP socket onto some URL? (like www.ex.com:8080/mySock/)

How to open PHP socket onto some URL? 如何打开PHP套接字到一些URL? (like www.ex.com:8080/mySock/) (例如www.ex.com:8080/mySock/)

I want to send user to a user Chart Room 1 if ho goes to www.ex.com:8080/mySock/Chart1 and www.ex.com:8080/mySock/Chart2 to some other chart room if he goes into another (live php multy useres chart on sockets (Flash backend)) 如果ho转到www.ex.com:8080/mySock/Chart1,而我又将www.ex.com:8080/mySock/Chart2转到其他某个图表室,则我想将用户发送给该用户的图表室1套接字上的php multy用户图表(Flash后端))

You can use: 您可以使用:

$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($socket, gethostbyname("www.ex.com"), 8080);

but are you sure you actually want a direct socket? 但是您确定您确实想要直接插座吗? If you clarify what you're actually doing, odds are PHP has some better way to accomplish it 如果您弄清楚自己在做什么,PHP可能会提供更好的方法来实现它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Javascript代码示例中使用变量:src =“ htp://www.url.com/file.php?id = [3434]” - How To Use Variable In Javascript Code Ex: src=“htp://www.url.com/file.php?id=[3434]” 如何从网址中获取PHP输入参数,例如www.domain.com/item/ABC123 - How to take PHP input parameter from URL like this www.domain.com/item/ABC123 如何在 Laravel 5.5 中生成类似博客文章 (www.abc.com/how-to-learn-php) 的 URL? - How to generate URL like blog post (www.abc.com/how-to-learn-php) in Laravel 5.5? 如何将我的URL像www.example.com/profile.php?id=xyz转换为www.example.com/xyz? - How do i convert my URL's like www.example.com/profile.php?id=xyz into www.example.com/xyz? 只允许PHP脚本打开网址,如www.mydomain.com/topsecret/1/001.jpg - only allow PHP scripts to open urls like www.mydomain.com/topsecret/1/001.jpg 如何指定一个SEO友好的URL,例如twitter www.twitter.com/ <name> 使用YII框架 - How to specify a SEO friendly url like twitter www.twitter.com/<name> using YII framework 如何在php中打开套接字 - how to open a socket in php 如何制作一个不带.php或.txt或其他任何内容的文件,类似于“ https://www.facebook.com/messages/100005408564” - how to make a file that looks like this “https://www.facebook.com/messages/100005408564” with no .php or .txt or anything 如何将网址从www.example.com/index.php?store=test重写为.htacess中的test.example.com或www.test.example.com - How to rewrite the url from www.example.com/index.php?store=test to test.example.com or www.test.example.com in .htacess PHP:URL格式www.mysite.com/users/33 - PHP: URL format www.mysite.com/users/33
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM