SA-MP Forums Archive
[PHP/Yini] PHP Yini reading from file - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [PHP/Yini] PHP Yini reading from file (/showthread.php?tid=406118)



[PHP/Yini] PHP Yini reading from file - DarkPower - 09.01.2013

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...


Re: [PHP/Yini] PHP Yini reading from file - DarkPower - 09.01.2013

bump, srry


Re: [PHP/Yini] PHP Yini reading from file - DarkPower - 10.01.2013

LAST chance bump


Re: [PHP/Yini] PHP Yini reading from file - tyler12 - 10.01.2013

This is for PAWN help.


Re: [PHP/Yini] PHP Yini reading from file - DarkPower - 10.01.2013

I understand that, i put in subject [PHP/Yini] and if someone have idea how i can make that my PHP read value BEHIND =_
(_ = Space)