Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> file_get_contents jak dodać do siebie wartości
hawkers
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 1.03.2016

Ostrzeżenie: (0%)
-----


  1. $numerb = file_get_contents('http://api.planetteamspeak.com/serverstatus/jakis serwer',false,null,109,2);
  2. $numerc = file_get_contents('http://tutaj adres strony/statyful.php',false,null,723,2);
  3. settype($numerb, "integer");
  4. settype($numerc, "integer");
  5. $slu=$numerb + $numerc;
  6. echo $slu ;

Jak dodać wyciągnięte te dwie wartości do siebie chodzi mi żeby były to cyfry?Pojedyńczo wyświetla,ale nie można ich do siebie dodać chodzi mi o zsumowanie.Za pomoc z góry dziękuje.
Sam nie mogę tego obejść bo nie mam takich wiadomości.

Ten post edytował hawkers 1.03.2016, 20:29:46
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
hawkers
post
Post #2





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 1.03.2016

Ostrzeżenie: (0%)
-----


Problem rozwiązałem ,kod był dobry,tylko z jednej zmiennej kopiowało nawias i temu nie mogłem dodać.Taki kodzik na przyszłość.
  1. $numer = file_get_contents('http://api.planetteamspeak.com/serverstatus/adres serwera/',false,null,109,2);
  2.  
  3. if(($numer=="0,")^($numer=="1,")^($numer=="2,")^($numer=="3,")^($numer=="4,")^($numer=="5,")^($numer=="6,")^($numer=="7,")^($numer=="8,")^($numer=="9,"))
  4. $c=1;
  5. else
  6. $c=2;
  7. $numerb = file_get_contents('http://api.planetteamspeak.com/serverstatus/adres serwera/',false,null,109,$c);
  8. $slu=$numerb + 5;
  9. echo $slu;


Ten post edytował hawkers 1.03.2016, 22:32:44
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 11.10.2025 - 22:20