"Array to string Conversion" error

Asked

Viewed 232 times

1

I have a page in php to edit files, where you write the name in an input and select the extension by a select, at the time of conversion it happens the error "Array to string Conversion". (Follow the code for analysis).

if(isset($_POST['nome'])){

    if(isset($_POST['ext'])){
     $arquivo = "./Arquivos/".$_POST['nome'].".".$_POST['ext'];
     } else{
     $arquivo = "./Arquivos/".$_POST['nome'].".".['extension'];
     }
     $fp = fopen($arquivo,"w");
     $fw = fwrite($fp,$_POST['texto']);  
     fclose($fp);
     include $arquivo; 
  }
  • The first 2 cases of closure refer to the problem itself, the third is a solution if you want to use multiple files/names. If none solves your case, please [Dit] post by adding the respective shipping code, and the exact line of the error. If it is not really a case covered by the links pointed out, the reopening of the post can be considered.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.