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, it also contains an optional rounds parameter to force multiple hashing.The salt on its own is a little shorter at only 16 characters but unlike Blowfish, it allows more than just alphanumeric characters.Example Live Demoecho 'SHA-256 (no rounds): ' . crypt('password-to-encrypt', '$5$YourSaltyStringz$'); echo 'SHA-512 (with rounds): ' . crypt('password-to-encrypt', '$6$rounds=1000$YourSaltyStringz$');OutputThis will ... Read More
To check the PowerShell version installed in your system, you can use either $PSVersionTable or $host command.Check if $host command available in remote servers.Open the PowerShell console in the system and run the command $PSVersionTable.$PSVersionTableOutputPS C:\WINDOWS\system32> $PSVersionTable Name Value ---- ----- PSVersion 5.1.18362.628 PSEdition Desktop PSCompatibleVersions ... Read More
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.
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 a "", 0, "0", or FALSE are set, and therefore are TRUE for ISSET.Example Live DemoOutputThis will produce the following output −0 is set with isset function array is not set.!empty functionEMPTY checks to see if a variable is empty. Empty is interpreted as: "" (an empty string), 0 (integer), 0.0 ... Read More
For this, use SUBSTRING_INDEX(). Let us first create a table −mysql> create table DemoTable2040 -> ( -> StudentCode varchar(20) -> ); Query OK, 0 rows affected (0.85 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2040 values('John-232'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable2040 values('Carol-901'); Query OK, 1 row affected (0.11 sec) mysql> insert into DemoTable2040 values('David-987'); Query OK, 1 row affected (0.21 sec)Display all records from the table using select statement −mysql> select *from DemoTable2040;This will produce the following output −+-------------+ | StudentCode | +-------------+ | ... Read More
PHP provides a function beginning from 5.3.0 to parse the ‘$_SERVER['HTTP_ACCEPT_LANGUAGE']’ variable into a locale −Example$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']); echo $locale;The ‘$_SERVER['HTTP_ACCEPT_LANGUAGE']’ function helps detect the locale by taking the current locale’s language as the parameter.OutputThis will produce the following output −en_USMost browsers submit an Accept-Language HTTP header that specifies en-us if they are from the US. Some older browsers use en only.English-UK based users usually set their system or user locale to English-UK, which is the default browser configuration. This would result in en-gb as the Accept Language header. Other countries have en locales, such as en-za (South Africa), and ... Read More
To display a list of records in a specific order, you need to set conditions and use ORDER BY. For this, use ORDER BY CASE statement. Let us first create a table −mysql> create table DemoTable2039 -> ( -> Name varchar(20) -> ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2039 values('John Doe'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable2039 values('John Smith'); Query OK, 1 row affected (0.08 sec) mysql> insert into DemoTable2039 values('Chris Brown'); Query OK, 1 row affected ... Read More
To return TRUE for positive values and FALSE for negative, use MySQL IF(). Let us first create a table −mysql> create table DemoTable2038 -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Value int -> ); Query OK, 0 rows affected (0.87 sec)Insert some records in the table using insert command −mysql> insert into DemoTable2038(Value) values(57); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable2038(Value) values(-100);; Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable2038(Value) values(-78); Query OK, 1 row affected (0.42 sec) mysql> insert into DemoTable2038(Value) ... Read More
Microsoft strongly advises not to use the automation of Office documents via COM objects. It quotes the following −“Microsoft does not currently recommend or support the Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.”A .docx file can be created without COM objects since it has XML foundations (PHPDOCX could be used for this). An added advantage of this method is that a local copy of Word that was installed wouldn’t have to be created ... Read More
This can be done using data URI in the image src attribute.Formatdata:[][;charset=""][;base64],
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP