Advertisement
Darksoul__

Untitled

Feb 4th, 2021
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. $news_t=array(
  2.                 "titolo"=>$_POST["titolo"],
  3.                 "autore"=>$_POST["autore"],
  4.                 "contenuto"=>$_POST["contenuto"],
  5.                 "generi"=>$_POST["generi"],
  6.                 "data_creazione"=>$_POST["data_creazione"]
  7.             );
  8.  
  9.             $file=fopen("array.txt", "w");
  10.             for($i=0;$i<count($news_array);$i++) {
  11.                 $out="";
  12.                 if($i!=$indice)
  13.                     foreach ($news_array[$i] as $key => $value)
  14.                         $out.=$value."|";
  15.                
  16.                 else
  17.                     foreach ($news_t as $key => $value)
  18.                         $out.=$value."|";
  19.                    
  20.                 $out=substr($out, 0,-1)."\n";
  21.                 fwrite($file,$out);
  22.             }
  23.            
  24.             fclose($file);
  25.             header("Location:index.php");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement