php increase number in file by one
<?php
$file = 'count.txt';
$fdata = file_get_contents ( $file );
$fdata = intval($fdata) + 1;
file_put_contents($file, $fdata);
?>
php increase number in file by one
<?php
$file = 'count.txt';
$fdata = file_get_contents ( $file );
$fdata = intval($fdata) + 1;
file_put_contents($file, $fdata);
?>
You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P.
You will be passed a file path P and string S on the command line. Output the number of times the string S appears in the file P.
file = open(P, 'r')
ptext = file.read()
print(ptext.count(S))
file.close()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us