php read config file help
#1

EDIT: i figured it out already!
this is a php question:

hers my problem, SAMP uses spaces in-between the varname and the vars so when im using php to explode the var, it only shows the first var.

heres the code:

Код:
$fp = fopen($config_file, "r");

	while (!feof($fp))
	{
		$line = trim(fgets($fp));
		$pieces = explode(" ", $line);
		$option = trim($pieces[0]);
		
		$value = trim($pieces[1]);
		
		$config_values[$option] = $value;
	}
	
	fclose($fp);
and this explains more of the problem
Код:
hostname Cops And Robbes
0    1  2 3
i can only define to explode 1 OR 2 OR 3, how can i do them all except for 0?

thanks for any help!
Reply
#2

anyone know php


EDIT: Got It! No Need To Let Me Know~!!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)