How-to articles, tricks, and solutions about FUNCTION

Calling a PHP function by onclick event

To call a PHP function using an onclick event, you will need to use a little bit of JavaScript.

Can we pass an array as parameter in any function in PHP?

Yes, you can pass an array as a parameter to a function in PHP.

Changing a global variable from inside a function PHP

In PHP, global variables can be accessed and modified from within functions using the global keyword.

Check if number is decimal

In PHP, you can use the is_float() function to check if a variable is a decimal number.

Colors in JavaScript Console

The console.log() method outputs a message to the web console. Read the tutorial and learn the simplest method of putting a single or multiple styles to it.

How are lambdas useful?

Lambdas, also known as anonymous functions, are useful in Python because they allow you to create small, one-time use functions without having to define them with a full function statement.

How can I handle the warning of file_get_contents() function in PHP?

The file_get_contents() function in PHP is used to read a file and return its contents as a string.

How do I call a function from another .py file?

You can call a function from another .py file by importing the file and then calling the function.

How to Add a Class to a Given Element

Read the tutorial and learn the two suggested methods of creating a JavaScript function that will add a class to the <div> element and solve your problem.

How To Add New Elements To A JavaScript Array

To add new elements you can use the following JavaScript functions: push() unshift(), concat() function or splice(). See examples.

How to change a string into uppercase?

In Python, you can use the built-in upper() method to change a string to uppercase.

How to Change the Href for a Hyperlink using jQuery

Read this JavaScript tutorial and learn the easy way of changing the href attribute for a hyperlink step by step by using one of the methods of jQuery.

How to Check for the Existence of Nested JavaScript Object Key

In this tutorial, you will find several methods that are used to test the existence of the nested JavaScript object keys. Also, find how to avoid TypeError.

How to Check if a Value is an Object in JavaScript

Checking the data type of the value can be misleading. Read this tutorial and learn which operator is used to check if a value is an object in JavaScript.

How to Check if a Variable is of Function Type

Read this JavaScript tutorial and learn several fast and useful methods that are invoked for checking whether the variable is of function type or not.

How to Check If an Element Contains a Class in JavaScript

Read this tutorial and learn valuable information about the multiple methods that are used for checking if the element contains a class in JavaScript.

How to Check if an Object has a Specific Property in JavaScript

Read this tutorial and learn the methods of checking whether the specified object has the specified property in JavaScript. Find the fastest one for you.

How to Check if Element is Visible after Scrolling

Read the tutorial and find out one of the methods of checking whether the element is visible after scrolling with jQuery. Also, find about utility function.

How to Check if Function Exists in JavaScript

In this tutorial, you will read and learn information about the two methods of checking whether a function exists in JavaScript or it has not been defined.

How to Convert a Unix Timestamp to Time in JavaScript

Read the tutorial and find how you can convert the UNIX timestamp to time in JavaScript to make the Unix format date-time value in a user-readable format.

How to Convert JavaScript String to be All Lowercase and Vice Versa

Read this tutorial and learn the way of making a JavaScript string all lowercase and uppercase with the help of toLowerCase() and toUpperCase() functions.

How to Convert Object to String

Read this JavaScript tutorial and learn about the fastest methods of converting object into string. Read about JSON.stringify() and toString() methods.

How to Convert String to Title Case with JavaScript

Read this JavaScript tutorial and learn information about the combinations of methods that make it possible to convert the string to title case easily.

How to Copy Array Items into Another Array

Read this JavaScript tutorial and learn several useful methods of copying array items into another array. Get to know which method to choose for your case.

1 2 3