Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Apache Version

Empfohlene Antworten

Hallo,

kann mir jemand sagen wie ich mir mit PHP die Apache Version anzeigen lassen kann. Mit 'apache_get_version' und '$_SERVER["SERVER_SOFTWARE"]' werden viel zu viele Information ausgegeben. Als Ausgabe soll so was wie: Apache/2.0.55 rauskommen.

Hat jemand von euch eine Idee?

Bei $_SERVER["SERVER_SOFTWARE"] sollte eigentlich sowas wie:

Apache/2.2.0 (Unix)

oder

Server: Apache/1.3.34 (Unix) PHP/4.4.1

o.ä. rauskommen. Das nimmst du einfach und holst dir die Angabe raus:



echo explode(" ", $_SERVER["SERVER_SOFTWARE"], 1)[0];

[/php]

sollte so gehen.

EDIT:

mit dem explode(..., ..., 1) bin ich mir nicht 100% sicher, könnte auch sein, dass du da 2 nehmen musst.

siehe: http://de.php.net/manual/de/function.explode.php

  • 2 Wochen später...

Danke für deine Antwort. ich habe das Problem so gelöst.


$string = apache_get_version();
$version_all = strrev($string);
$version_rev = strrchr($version_all, " ");
$version_apache = strrev($version_rev);
[/PHP]

ist zwar keine elegante Lösung aber funktioniert.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.