Search
 
SCRIPT & CODE EXAMPLE
 

PHP

python truncate file contents

//one way is to open the file for writing
file = open("sample.txt","w")
file.close()

//another way
file = open("example.txt","r+")
file.truncate(0)
file.close()
Comment

PREVIOUS NEXT
Code Example
Php :: Drupal 9 cache killer kill switch 
Php :: whereyear laravel 
Php :: php maxupload 
Php :: collection laravel filter 
Php :: check if array has value php 
Php :: PHP strncmp — Binary safe string comparison of the first n characters 
Php :: laravel vendor publish all files 
Php :: wordpress logout redirect to home 
Php :: how to get the link of the current page in php 
Php :: eloquent using last() 
Php :: how to add properties to the request object 
Php :: reindex array php 
Php :: Load order by entity_id magento 2 
Php :: doctrine php driver execption 
Php :: find distance between two coordinate in php 
Php :: redirect php 
Php :: laravel redirect back with input 
Php :: mkdir() permission denied laravel 
Php :: ci3 upload file 
Php :: add column in laravel migration cmnd 
Php :: get host from url php 
Php :: lazychaser laravel-nestedset get tree 
Php :: how to check php string length 
Php :: qual é a melhor linguagem de 
Php :: php date format 
Php :: how to check number only in php 
Php :: cart icon in woocommerce 
Php :: string to float laravel 
Php :: show date time with milliseconds php 
Php :: sort multi array php 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =