PHPUnit | assertContains() function
The assertContains() function is a builtin function in PHPUnit and is used to assert an array having a value. This assertion will return true in the case if the array contains the provided value else return false and in case of true the asserted test case got passed else test case got failed....
read more
PHP | http_build_query() Function
The http_build_query() function is an inbuilt function in PHP which is used to generate URL-encoded query string from the associative (or indexed) array....
read more
How to pass PHP Variables by reference ?
By default, PHP variables are passed by value as the function arguments in PHP. When variables in PHP is passed by value, the scope of the variable defined at function level bound within the scope of function. Changing either of the variables doesn’t have any effect on either of the variables....
read more
How to convert an Integer Into a String in PHP ?
The PHP strval() function is used to convert an Integer Into a String in PHP. There are many other methods to convert an integer into a string....
read more
How to Insert JSON data into MySQL database using PHP?
To insert JSON data into MySQL database using PHP, use the json_decode function in PHP to convert JSON object into an array that can be inserted into the database....
read more
How to convert String to Float in PHP ?
Strings in PHP can be converted to float very easily. In most use cases, it won’t be required since PHP does implicit type conversion. There are many methods to convert a string into a number in PHP, some of them are discussed below:...
read more
JavaScript Function binding
In JavaScript function binding happens using the Bind() method. With this method, we can bind an object to a common function, so that the function gives different results when needed. otherwise, it gives the same result or gives an error while the code is executing. We use the Bind() method to call a function with ‘this’ value....
read more
PHP | sleep( ) Function
The sleep() function in PHP is an inbuilt function which is used to delay the execution of the current script for a specified number of seconds. The sleep( ) function accepts seconds as a parameter and returns TRUE on success or FALSE on failure....
read more
PHP array_combine() Function
The array_combine() is an inbuilt function in PHP which is used to combine two arrays and create a new array by using one array for keys and another array for values. That is all elements of one array will be the keys of new array and all elements of the second array will be the values of this new array....
read more
htmlentities() vs htmlspecialchars() Function in PHP
The htmlentities( ) and htmlspecialchars( ) in PHP both convert special characters to their HTML entities, but ‘htmlspecialchars()’ only converts characters that have special meaning in HTML, while ‘htmlentities( )’ converts a broader range of characters. In this article, we will see what htmlentities( ) & htmlspecialchars( ) Function is used for & also understand their implementation through the examples....
read more
JavaScript setTimeout() & setInterval() Method
JavaScript SetTimeout and SetInterval are the only native function in JavaScript that is used to run code asynchronously, it means allowing the function to be executed immediately, there is no need to wait for the current execution completion, it will be for further execution....
read more
How to Remove an Entry by Key in JavaScript Object?
In JavaScript, objects store data in the form of key-value pairs where the key may be any property of the object. In this article let us see how to remove key-value pairs a by given key in the object....
read more