PHP getrandmax() Function

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

206 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

971 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

248 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

141 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

758 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

88 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

PHP exp() Function

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

161 Views

Definition and UsageThe exp() function calculates exponent of e that is Euler Number. PHP has a predefined constant M_E that represents Euler Number and is equal to 2.7182818284590452354. Hence, exp(x) returns 2.7182818284590452354xThis function always returns a float.Syntaxexp ( float $arg ) : floatParametersSr.NoParameter & Description1arga floating point number to raise e toReturn ValuesPHP exp() function returns the Euler Number e raised to given arg. Note that e is base of natural algorithm. The exp() function is inverse of natural logarithm.Hence, if logex = y, then ey=xPHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP ... Read More

HTML td colspan Attribute

Ankith Reddy
Updated on 29-Jun-2020 08:46:43

604 Views

The colspan attribute of the element in HTML defines the number of columns a cell should span.Following is the syntax −Above, num is the count of columns a cell should span.Let us now see an example to implement the colspan attribute of the element −Example Live Demo table, th, td {    border: 2px solid blue; } Product Expenses           Domains       Cost               Product Development       500000               Marketing       500000               Services       100000               Support       100000               Maintenance       100000               Total Budget = INR 1300000     Output

PHP deg2rad Function

Malhar Lathkar
Updated on 29-Jun-2020 08:46:07

240 Views

Definition and UsageMost trigonometric functions like sin, cos, tan etc require angle argument in radians. The deg2rad() function proves useful in conversion of degrees to radians.This function returns a float number such that number=deg2rad(x) where is angle in degrees. angle in radian = angle in deg *180/piFor example deg2rad(30) is equal to 0.5235987755983 radiansSyntaxdeg2rad ( float $number ) : floatParametersSr.NoParameter & Description1numberA float number reprsenting angle in degreesReturn ValuesPHP deg2rad() function returns a float number that represents angle in radians.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates radian equivalent ... Read More

Advertisements