Please how do I solve this question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Please how do I solve this question

Fill in the blanks to write the numbers 1 to 10 to the file. $h = ______ ('file.txt', 'a'); for($i=1;$i<=10; $i++) { ______($h, $i); } ______($h);

15th Dec 2016, 10:21 AM
Ojo Oluwaseun Joseph
Ojo Oluwaseun Joseph - avatar
12 Answers
+ 7
$h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) { fwrite ($h, $i); } fclose ($h);
14th Mar 2020, 12:10 PM
Mahnoor Shahzad
Mahnoor Shahzad - avatar
+ 1
fopen-that is file open function fwrite-that is file read/write function fclose-that is file close function
12th Mar 2019, 6:07 AM
mahaveer pts
mahaveer pts - avatar
0
Oh no is answering but fortunately, I got the answer... $h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) {fwrite($h, $i); }fclose($h);
15th Dec 2016, 10:31 AM
Ojo Oluwaseun Joseph
Ojo Oluwaseun Joseph - avatar
0
$h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) { fwrite ($h, $i); } fclose ($h);
2nd Mar 2017, 8:48 PM
Notan Mondal
0
Fill in the blanks to open the file using append mode, write to it, and close it. $h = //fopen ('my.txt', ' //a '); fwrite($h, 'test'); //fclose ($h); // answer shown
1st Mar 2020, 5:35 AM
Sadman Fahim
Sadman Fahim - avatar
0
$h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) { fwrite ($h, $i); } fclose ($h);
9th Jul 2020, 8:32 PM
Faith Mundi
Faith Mundi - avatar
0
fopen , a and fclose
17th May 2022, 7:13 AM
Megha Raj kandel
- 1
$h = fopen ('my.txt', ' a '); fwrite($h, 'test'); fclose ($h);
19th Dec 2020, 5:34 PM
El Maslohi Hassan
- 2
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................hmmmm
16th Aug 2018, 8:16 PM
Abdelrahman
Abdelrahman - avatar
- 3
Rearrange the code to write 12 to the file 'num.txt'. fwrite($handle, '1'); $handle = fopen('num.txt', 'w'); fwrite($handle, '2'); fclose($handle);
10th May 2018, 5:16 PM
CPN PRAJAPATI
CPN PRAJAPATI - avatar
- 3
$h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) { fwrite($h, $i); } fclose($h); php
6th Aug 2018, 11:37 AM
Rinae Tshivhinda
Rinae  Tshivhinda - avatar
- 3
Answer is $h = fopen ('file.txt', 'a'); for($i=1;$i<=10; $i++) { fwrite ($h, $i); } fclose ($h);
17th Dec 2018, 1:13 PM
ISSAM ES SOUFY
ISSAM ES SOUFY - avatar