Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailem Jak vytvořit return true/false

function write (){
    $file = 'people.txt';
    try {
        $current = file_get_contents($file); // Open the file to get existing content
        $current .= "John Smith\n"; // Append a new person to the file
        file_put_contents($file, $current); // Write the contents back to the file
        return true;
    } catch (Exception $e) {
        return false;
    }
}

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny