I have some php scripts that I use on several machines. Each machine has an
identical copy of a mysql database that the scripts run against. The only
differences in the DBs are the user names and passwords (they all differ).
Fortunately, each machine is a different version of Unix or Linux, so I've
instructed the script to do a uname test before connecting to the local
database. However, I don't know how to test the variable that contains the
uname string.
$x = php_uname();
print $x;
// The print looks like this:
Linux localhost 2.4.22-gentoo-r5 #4 Mon Feb 2 18:28:44 EST 2004 i686
if ($x contains "gentoo") // How do I test this string for "gentoo"
{
connect to this db
}
else
......
identical copy of a mysql database that the scripts run against. The only
differences in the DBs are the user names and passwords (they all differ).
Fortunately, each machine is a different version of Unix or Linux, so I've
instructed the script to do a uname test before connecting to the local
database. However, I don't know how to test the variable that contains the
uname string.
$x = php_uname();
print $x;
// The print looks like this:
Linux localhost 2.4.22-gentoo-r5 #4 Mon Feb 2 18:28:44 EST 2004 i686
if ($x contains "gentoo") // How do I test this string for "gentoo"
{
connect to this db
}
else
......
Comment