10-15-2009, 08:22 AM
|
#1 (permalink)
|
|
That guy
Join Date: Sep 2009
Location: San Antonio, TX
Posts: 24
Thanks: 0
|
Stumbled upon something here..
Well, I was looking through the PHP documentation, and I came across a neat function called parse_str. I was wondering, would it be wise to use this for storing, and using database details?
PHP Code:
$str = "host=localhost&user=root&pass=pass&name=db_name";
parse_str($str);
Then:
PHP Code:
echo "$host, $user, $pass, $name";
Would output "localhost, root, pass, db_name."
|
|
|
|