0
I’m wearing a API to capture proxies. She returns to me the proxies in format JSON, as follows:
{
"_links": {
"_self": "\ / proxy",
"_parent": "\ /"
},
"ip": "45.55.23.78",
"porto": 1080,
"protocolo": "socks5",
"anonimato": "alto anonimato",
"LastTested": "2018-03-09 06:51:27",
"permiteRefererHeader": true
"permiteUserAgentHeader": true
"permiteCustomHeaders": true,
"permiteCookies": true
"permitePost": verdadeiro,
"permiteHttps": true
"país": "EUA",
"connectTime": "0.721",
"downloadSpeed": "160,000",
"secondsToFirstByte": "1.079",
"tempo de atividade": "99.164"
}
I want to get just the IP and the door, but I need to put the two together to stay this way the result: 45.55.23.78:1080.
I was capturing it that way:
$f = file_get_contents("link da minha api");
$json = json_decode($f);
$proxy = $json->ip;
$porta = $json->port;
Only I need you both to stay in one variable, for example $ipPort = $json->ip:port
. It’s just an example, I don’t know how to do this so I need your help.
It is also possible to do as follows:
$proxy = "{$json->ip}:{$json->port}";
orsprintf("%s:%s", $json->ip, $json->port);
– Valdeir Psr