PHP hexdec Function

Malhar Lathkar
Updated on 29-Jun-2020 08:57:15

132 Views

Definition and UsageThe hexdec() function returns a decimal number equivalent of a hexadecimal number embedded in a string.This function returns a a decimal integer, though larger values may result in floats.Syntaxhexdec ( string $hex_string ) : numberParametersSr.NoParameter & Description1hex_stringA decimal number to be converted in equivalent octal representationReturn ValuesPHP hexdec() function returns a decimal number.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates decimal equivalent of '100' and returns 256 −OutputThis will produce following result −hexdec(100) = 256Example Live DemoIf the string contains invalid characters (other than 0-9 and a-f) they ... Read More

Set Max Connections in MySQL Programmatically

George John
Updated on 29-Jun-2020 08:57:05

347 Views

To set max_connections in MySQL programmatically, you can use SET command. The syntax is as follows −SET GLOBAL max_connections=yourIntegerValue;Let us implement the above query to set maximum connections. The query is as follows −mysql> set global max_connections=1000; Query OK, 0 rows affected (0.04 sec)Check maximum connections are set or not, using the show variables command. The query is as follows.mysql> show variables like 'max_connections';The following is the output.+-----------------+-------+ | Variable_name   | Value | +-----------------+-------+ | max_connections | 1000  | +-----------------+-------+ 1 row in set (0.18 sec)

What is Global Namespace Pollution in JavaScript

vineeth.mariserla
Updated on 29-Jun-2020 08:55:29

1K+ Views

Global namespace pollutionPolluting Global namespace causes name collision. This name collision is very common in large projects where we may be using several javascript libraries. Let's discuss in detail what a name collision is.let's take a scenario in which 2 teams named A1 and A2 are working on a project. They both prepared their own javascript files that is TeamA1.js and TeamA2.js as shown below.TeamA1.jsTeamA1 has created a student function and has 2 parameters fname and lname(firstname & lastname).function student(fname, lname){    this.fname = fname;    this.lname = lname;    this.getFullName = function (){       return this.fname + " " ... Read More

PHP getrandmax() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:54:47

208 Views

Definition and UsageThe getrandmax() function returns largest integer that can be used in PHP. Value returned by this function serves as the upper limit for rand() function to generate random number.This function always returns an integer.Syntaxgetrandmax ( void ) : intParametersSr.NoParameter & Description1This function needs no parametersReturn ValuesPHP getrandmax() function returns largest possible integer that can be used in PHP. On 64 bit Windows, the number is 2147483647PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example returns largest possible integer−OutputThis may produce following result (it being a random number, it is ... Read More

Force MySQL LIKE to Be Case-Sensitive

Rishi Rathor
Updated on 29-Jun-2020 08:53:21

977 Views

To force MySQL LIKE to be case sensitive with the help of LIKE BINARY, the following is the syntax −select yourColumnName like binary 'anyStringValue' from yourTableName;To understand the above concept, let us create a table. The following is the query to create a table −mysql> create table LikeBinaryDemo    −> (    −> Name varchar(200)    −> ); Query OK, 0 rows affected (0.58 sec)Now you can insert records with small letters to force the MySQL LIKE to be case sensitive −mysql> insert into LikeBinaryDemo values('john'); Query OK, 1 row affected (0.12 sec)Display the records in the table. The query ... Read More

PHP fmod Function

Malhar Lathkar
Updated on 29-Jun-2020 08:53:16

251 Views

Definition and UsageThe name fmod stands for floating modulo . This function returns remainder of division of two floating point numbers. If  x/y results in i as division and r as remainder so thatx = y*i+r In this case,  fmod(x, y) returns rSyntaxfmod ( float $x , float $y ) : float ParametersSr.NoParameter & Description1xThis parameter forms numerator part of division expression2yThis parameter forms denominator part of division expressionReturn ValuesPHP fmod() function returns floating point remainder of the act of division of x by y. Remainder carries sign of x.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as ... Read More

HTML area Tag

Chandu yadav
Updated on 29-Jun-2020 08:53:06

151 Views

The area tag in HTML is used to set an area in image map.Following are the attributes −AttributeValueDescriptionalttextSpecifies an alternate text for the area.coordsif shape = "rect" then coords = "left, top, right, bottom"if shape = "circ" then coords = "centerx, centery, radius"if shape = "poly" then coords = "x1, y1, x2, y2, .., xn, yn"Specifies the coordinates appropriate to the shape attribute to define a region of an image for image maps.downloadfilenameSpecifies that the target gets downloaded when hyperlink is clicked by user.hrefURLSpecifies the URL of a page or the name of the anchor that the link goes to.hreflanglanguage_codeSpecifies ... Read More

PHP Floor Function

Malhar Lathkar
Updated on 29-Jun-2020 08:51:42

769 Views

Definition and UsageThe floor() function is another in-built function in PHP iterpreter. This function accepts any float number as argument and rounds it down to the next lowest integer.This function always returns a float number as range of float is bigger than that of integer.Syntaxfloor ( float $num ) : floatParametersSr.NoParameter & Description1numThe number to be rounded down.Return ValuesPHP floor() function returns the largest integer less than or equal to given parameter.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example rounds 15.05 to its next highest integer which is 15OutputThis will ... Read More

Pass by Reference and Pass by Value in PHP

Alok Prasad
Updated on 29-Jun-2020 08:51:12

6K+ Views

In this article, we will learn about pass by value and pass by reference in PHP. Now, let’s understand these two concepts in detail.In PHP generally, we followed to pass the arguments to the function with passed by value approach. We are following this practice because if the value of the argument within the function is changed, it does not get changed outside of the function.In some cases we may need to modify function arguments, So to allow a function to modify its arguments, they must be passed by reference.Let's begin with passed by reference. As it is already mentioned we ... Read More

PHP expm1 Function

Malhar Lathkar
Updated on 29-Jun-2020 08:49:09

89 Views

Definition and UsageThe expm1() function returns exp(number) - 1, computed in a way that is accurate even when the value of number is close to zero, a case where 'exp (number) - 1' would be inaccurate due to subtraction of two numbers that are nearly equal.expm1(x) = exp(x) - 1This function returns a float value .Syntaxexpm1 ( float $arg ) : floatParametersSr.NoParameter & Description1argA floating point number whose expm1 is to be calculated.Return ValuesPHP expm1() function returns a floating point value.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates expm1(2) ... Read More

Advertisements