[PHP/Yini] PHP Yini reading from file
#1

This is function for YINI int reading...
PHP Code:
function YINI_IntGet($filename,$key
    {
        if(
file_exists($filename))
        {
            
$lines file($filename);
            foreach (
$lines as $line
            {
                
$line rtrim($line);
                if(
stristr($line$key."="))
                {
                    
$string str_replace($key."=","",$line);
                }
            }
        }
        else
        {
            return (int)
"";
        }
        return (int)
$string;
    } 
This is code for show file line value:

PHP Code:
ftp_chdir($conn_id"/samp_2700/scriptfiles/Users");
    
$NICK_ $_POST['nick'].".ini";
    if (
ftp_size($conn_id$NICK_) >= 0)
    {
        
ftp_get($conn_id"account"$NICK_,FTP_BINARY);
        echo 
"You are viewing stats of ".$_POST['nick']."<br />";
        echo 
"Player has $".YINI_IntGet(NICK_"Money")." dollars!";
        
unlink($NICK_);
    }
    else 
    {
        echo 
"User ".$_POST['nick']." is not registered!";
    } 
The problem is, when i type my nick, in file i have over $150,000 but i see this

http://i.imgur.com/gxGtz.png

The final problem is that yini save line in format

Code:
Money = VALUE
but my code read's like

Code:
Money=VALUE
my code does not recognize the spacing...
Reply


Messages In This Thread
[PHP/Yini] PHP Yini reading from file - by DarkPower - 09.01.2013, 07:52
Re: [PHP/Yini] PHP Yini reading from file - by DarkPower - 09.01.2013, 18:16
Re: [PHP/Yini] PHP Yini reading from file - by DarkPower - 10.01.2013, 16:58
Re: [PHP/Yini] PHP Yini reading from file - by tyler12 - 10.01.2013, 16:59
Re: [PHP/Yini] PHP Yini reading from file - by DarkPower - 10.01.2013, 17:01

Forum Jump:


Users browsing this thread: 1 Guest(s)