<?php $number = 5030; echo number_format($number); // 5,030 ?>
Tag Archives: Functions
Function to read the character from the ASCII value – PHP
<?php echo chr(50).","; echo chr(55).","; echo chr(53); ?>
How to encode the data – PHP
<?php echo base64_encode("First"); ?>
How to check whether a file exists or not – PHP
<?php if(file_exists($filePath)) echo "Exists" ?>
How to terminate the current script – PHP
<?php chmod("../".$image_thumb_path_medium,0777) or die("Could not change permission thumb"); chmod("../".$image_thumb_path_medium,0777) or exit("Could not change permission thumb"); ?>
Modify the permission of a file/directory – PHP
<?php chmod("/your_dir/your_file", 0600); // Read and write for owner, nothing for everybody else chmod("/your_dir/your_file", 0644); // Read and write for owner, read for everybody else chmod("/your_dir/your_file", 0755); // Everything for owner, read and execute for others chmod("/your_dir/your_file", 0750); // Everything for owner, read and execute for owner's group ?>