PHP string sha1_file() Function4 Sept 2024 | 1 min read The sha1_file() function is predefined PHP string function. It is used to calculate the SHA-1 hash of a file. It uses he US secure Hash Algorithm 1 and calculate the ha1 hash US secure Hash Algorithm 1. The hash is a 40 character hexadecimal number. It returns the calculated SHA-1 hash on success or False on failure. Syntax:
Example 1Save it: "test.txt" Save it: test.php Output: Your filename is:test.txt By using sha1_file() function:a02e266c6f3a8ff0c4250e502828c4ebf179d252 Example 2Save it: "test.txt" Save it: "sha1file.txt" Save it: "index.php" Save it: "test.php " Output: The file is ok. Note: If "test.txt" has been changed (that is if the SHA-1 hash has been changed):Next TopicPHP String |
PHP Function PHP convert_cry_string() function is used to convert from one Cyrillic character-set to another. Syntax: string convert_cyr_string ( string $str , string $from , string $to ); Parameter Description Required/Optional String String to convert Required from Specify the Cyrillic character-set to convert. Required to Specify the Cyrillic character-set to convert. Required The supported Cyrillic character-sets are; k - koi8-r w -...
1 min read
PHP Function PHP function is used to write a formatted string to a stream. In another words we can say that this function format string to a specified output stream( file or database). Syntax: fprintf(stream,format,arg1,arg2,arg++) Parameter Description Required/Optional stream Specify string where to write /output the string Required Format Specify the string. Required arg1 Specify the argument to...
2 min read
PHP String Function The function is an in-built function of PHP, which converts pre-defined HTML entities to characters. It is opposite to the htmlspecialchars() function. HTML entities decoded back to the character will be like- & converts as & (ampersand) " converts as " (double-quote) ' converts as...
3 min read
PHP string md5_file() Function PHP string md5_file() function is in-built important function. It is used to calculate the MD5 hash of a file. It uses the RSA Data Security. It returns the md5 hash on success, or FALSE on failure. Syntax: md5_file(file,raw); Parameter Description Required/Optional File Specify the file to be calculated. Required Raw Specify the Boolean...
1 min read
PHP Function The is predefine string function of PHP. It is used to compare two strings. This function is binary-safe, case-sensitive and similar to strcmp() function but strcmp() have no the length parameter. The strncmp () function is often used in programming and web development...
1 min read
PHP Function The strops() is in-built function of PHP. It is used to find the position of the first occurrence of a string inside another string or substring in a string. Syntax: int strpos ( string $haystack , mixed $needle [, int $offset = 0 ] ); Parameter Description Required/Optional string Specify the...
2 min read
PHP string Function The is in-built function of PHP. It is used to return information about words used in a string or counts the number of words in a string. Syntax: str_word_count(string,return,char) Parameter Description Required/Optional string Specify the string to check. Required. return Specify the return value of the function. Values: 0 : It is by default...
1 min read
PHP string function PHP string function is in-built function. It is used to strip whitespace from the beginning and end of a string or both side of a string. Syntax: trim(string,charlist); Parameter Description Required/Optional String Specify the string to check. Required charlist Specify the characters to remove. Following character: "\0" - NULL "\t" - tab "\n" - new line "\x0B"...
1 min read
PHP Function The function is predefined function of PHP. It is used to reverse a string. It is one of the most basic string operations which are used by programmers and developers. Syntax: string strrev ( string $string ); Parameter Description Required/Optional String Specify the string to reverse Required Example 1 <?php $var1="Hello PHP"; ...
1 min read
PHP String function The is an in-built function of PHP, which is used to replace a substring inside the other string. It provides the facility to change the particular word in a string. The function translates characters or replaces the substrings. It is a...
3 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India