[Ajuda] PHP ligado ao samp
#1

Entгo como eu nгo entendo PHP, e nгo conheзo que entenda venho aqui postar esta duvida,
ja que aqui existem varios programadores.
Eu gostaria de saber o que ocorre nestas duas linhas:
PHP код:
$sign = !isset($_GET['s']) ? $_GET['s'];
$nome = !isset($_GET["Nome"]) ? "None" $_GET['name']; 
E qual a diferenca entre a funзгo a seguir e a parse_ini_file nativa?
PHP код:
    function parse_ini_file2($f)
    {
         
$newline "<br>";
         
$null "";
         
$r=$null;
         
$first_char "";
         
$sec=$null;
         
$comment_chars="/*<;?>";
         
$num_comments "0";
         
$header_section "";
         
//Read to end of file with the newlines still attached into $f
         
$f=@file($f);
         
// Process all lines from 0 to count($f) 
         
for ($i=0;$i<@count($f);$i++)
         {
              
$newsec=0;
              
$w=@trim($f[$i]);
              
$first_char = @substr($w,0,1);
              if (
$w)
              {
                   if ((!
$r) or ($sec))
                   {
                       
// Look for [] chars round section headings
                       
if ((@substr($w,0,1)=="[") and (@substr($w,-1,1))=="]") {$sec=@substr($w,1,@strlen($w)-2);$newsec=1;}
                       
// Look for comments and number into array
                       
if ((stristr($comment_chars$first_char) === FALSE)) {} else {$sec=$w;$k="Comment".$num_comments;$num_comments $num_comments +1;$v=$w;$newsec=1;$r[$k]=$v;}
                       
//
                   
}
                   if (!
$newsec)
                   {
                       
//
                       // Look for the = char to allow us to split the section into key and value 
                       
$w=@explode("=",$w);$k=@trim($w[0]);unset($w[0]); $v=@trim(@implode("=",$w));
                       
// look for the new lines 
                       
if ((@substr($v,0,1)=="\"") and (@substr($v,-1,1)=="\"")) {$v=@substr($v,1,@strlen($v)-2);}
                       if (
$sec) {$r[$sec][$k]=$v;} else {$r[$k]=$v;}
                   }
              }
         }
         return 
$r;
    } 
Obrigado
Reply


Messages In This Thread
PHP ligado ao samp - by Dayvison_ - 21.02.2015, 17:29
Re: PHP ligado ao samp - by ipsLuan - 21.02.2015, 17:32
Re: PHP ligado ao samp - by Dayvison_ - 21.02.2015, 17:49
Re: PHP ligado ao samp - by Gii - 21.02.2015, 17:51
Re: PHP ligado ao samp - by RaphaelCaldas - 21.02.2015, 18:00
Re: PHP ligado ao samp - by Dayvison_ - 21.02.2015, 18:10
Re: PHP ligado ao samp - by RaphaelCaldas - 21.02.2015, 18:16
Re: PHP ligado ao samp - by Dayvison_ - 21.02.2015, 18:18
Re: PHP ligado ao samp - by RaphaelCaldas - 21.02.2015, 18:24
Re: PHP ligado ao samp - by Dayvison_ - 21.02.2015, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)