
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 10744 Articles

AmitDiwan
343 Views
PHP doesn't support friend-like declarations. It can be simulated in PHP5 using the __get and __set methods and by inspecting a backtrace for the allowed friend classes. But this type of coding practice is considered to be clumsy −class sample_friend { private $__friends = array('My_Friend', 'Other_Friend'); public function ... Read More

AmitDiwan
463 Views
The .ini files from the main php, ini file can’t be included. Instead, while compiling PHP, the line--with-config-file-scan-dir=PATH can be added.The ‘PATH’ in the above line refers ... Read More

AmitDiwan
1K+ Views
The memory_get_usage function can be used to track the memory usage. The ‘malloc’ function is not used for every block required, instead a big chunk of system memory is allocated and the environment variable is changed and managed internally.The two different types of memory usages are −The memory required by ... Read More

AmitDiwan
2K+ Views
The ‘fgets’ function reads a line and stops when it encounters a newline −The above code opens a text file named ‘test’ in the read mode and reads the contents of the file until a newline character is encountered beginning from the starting byte. The file is then closed.The ‘fread’ ... Read More

AmitDiwan
987 Views
To read a single fine inside z zip archive, the code is as follows −$handle = fopen('zip://test.zip#test.txt', 'r'); $result = ''; while (!feof($handle)) { $result .= fread($handle, 8192); } fclose($handle); echo $result;The output will be the contents of the zip file.

AmitDiwan
186 Views
pdependThe function pdepend is used to generate a large set of software metrics from a given code base. The generated values can be used to measure the quality of a software project. They help in identifying the parts of an application where refactoring is required.phpmdThe phpmd scans the PHP source ... Read More

AmitDiwan
215 Views
The syntax ‘$string{0} ‘ has been deprecated beginning from PHP version 6. Hence, it is strongly suggested to use $string[0].In short, accessing characters using the flower braces {} has been deprecated. Hence the square brackets should be used [] −Example Live Demo$string = 'medium'; echo $string{0}; echo $string[0];OutputThis will produce the ... Read More

AmitDiwan
321 Views
Due to the fact that Blowfish has vulnerabilities before PHP version 5.3.7, it would be suggested to use SHA-256 or SHA-512 instead. Both of them have a similar salt format similar to that of Blowfish (use a prefix of $5$ for SHA-256 and $6$ for SHA-512). In addition to this, ... Read More

AmitDiwan
1K+ Views
The ‘memory_limit’ is the maximum amount of server memory that a single PHP script is allowed to use. The value needs to be converted before comparing the threshold of memory.For example − 64M is converted to 64 * 1024 * 1024. After this, the comparison is done and the result is printed out.

AmitDiwan
926 Views
Isset functionISSET checks the variable to see if it has been set. In other words, it checks to see if the variable is any value except NULL or not assigned a value. ISSET returns TRUE if the variable exists and has a value other than NULL. That means variables assigned ... Read More