Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $imoveis = array();
- $quebra = chr(13).chr(10);
- $arq = fopen("imo/imoveis.txt", "r");
- while (!feof($arq)){
- array_push($imoveis, explode(";", fgets($arq)));
- }
- fclose($arq);
- $arq = fopen("imo/imoveis.txt", "w");
- for ($imoveis as $imovel) {
- if ($_POST['imovel'] === $imovel[0]) { // verifica se a posição 0 (endereço) é igual a digita no imovel
- $imovel[2] = "locado"; // altera a posição 2 (status) pra locado
- }
- fputs($file, implode(";", $imovel) . ";$quebra"); // sobrescreve arquivo
- }
- fclose($arq);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement