PHP is_nan() Function

Malhar Lathkar
Updated on 29-Jun-2020 09:05:16

916 Views

Definition and UsageNAN stands for "Not A Number". The is_nan() function checks whether its argument is not a number.Syntaxis_nan ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if infinite or notReturn ValuesPHP is_nan() function returns TRUE if val is "not a number", otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 qualifies as NANOutputThis will produce following result −int(100) bool(false)Example Live DemoValue of log(0) is infinity. Following example verifies if it is NAN −OutputThis will produce following result −float(-INF) bool(false)Example Live DemoSince cos(x) ... Read More

HTML Button Autofocus Attribute

George John
Updated on 29-Jun-2020 09:05:05

286 Views

The autofocus attribute of the element is used to set focus to the button whenever page loads.Following is the syntax −Above, we have set autofocus to a button. Let us now see an example to implement the autofocus attribute of the element −Example Live Demo    Demo Heading    This is a demo line.    Demo OutputThis will produce the following output displaying the focus is on button 1 −In the above example, we have set the autofocus attribute for the button element −    Demo Now, when the page loads, the focus would be on ... Read More

PHP is Infinite Function

Malhar Lathkar
Updated on 29-Jun-2020 09:03:58

282 Views

Definition and UsageThe is_infinite() function returns a boolean value. It checks whether given parameter is an infinnite number and if so the function returns TRUE, otherwise FALSE. A number is treated as infinite if it is beyond acceptable range of float in PHP.Syntaxis_infinite ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if infinite or notReturn ValuesPHP is_infinite() function returns TRUE if val is outside accepted range of float, otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 is not an ... Read More

HTML area Target Attribute

George John
Updated on 29-Jun-2020 09:03:11

152 Views

The target attribute of the element allows you to set where the linked document will open, for example, new window, same frame, parent frame, etc.Following is the syntax −Here,  _blank is used to open the linked document in new window or tab, _self opens the linked document in the same frame as it was clicked, _parent opens the document in the parent frame, _top opens the linked document in the entire body of the window, frame opens the linked document in a named frame.Let us now see an example to implement the target attribute of the elemen −Example Live ... Read More

Use User Variables in MySQL LIKE Clause

Ankith Reddy
Updated on 29-Jun-2020 09:02:51

4K+ Views

Using the CONCAT() function, we can work with user variables in LIKE clause. The syntax is as follows.set @anyVariableName='anyValue'; select yourColumnName1, yourColumnName2, yourColumnName3, ...N from yourTableName whereyourColumnName like CONCAT('%', @anyVariableName, '%');To understand the above syntax, let us first create a table. The query to create a table is as follows.mysql> create table UserVariableInLike -> ( -> id int, -> Name varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.83 sec)Insert records in the table using insert command. The query is as follows.mysql> insert into UserVariableInLike values(101, 'John', 23); Query OK, 1 row affected (0.23 sec) mysql> ... Read More

PHP is_finite() Function

Malhar Lathkar
Updated on 29-Jun-2020 09:02:19

146 Views

Definition and UsageThe is_finite() function returns a boolean value. It checks whether given parameter is a legal finite number and if so the function returns TRUE, otherwise FALSESyntaxis_finite ( float $val ) : bool ParametersSr.NoParameter & Description1valThe value to be verified if finite or notReturn ValuesPHP is_finite() function returns TRUE if val is within accepted range of float, otherwise it returns FALSE.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example shows that 100 is a finite numberOutputThis will produce following result −100 is a finite numberExample Live DemoValue of log(0) is undefined. ... Read More

PHP intdiv Function

Malhar Lathkar
Updated on 29-Jun-2020 09:00:19

74 Views

Definition and UsageThe intdiv() function returns integer quotient of two integer parameters. If  x/y results in i as division and r as remainder so thatx = y*i+r In this case,  intdiv(x, y) returns i Syntaxintdiv ( int $x , int $y ) : int ParametersSr.NoParameter & Description1xThis parameter forms numerator part of division expression2yThis parameter forms denominator part of division expressionReturn ValuesPHP intdiv() function returns integer quotient of division of x by y. The return value is positive if both parameters are positive or both parameters are negative.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live ... Read More

Concat a String to Select in MySQL

Ankith Reddy
Updated on 29-Jun-2020 08:59:56

238 Views

To concat a string, use the CONCAT() function from MySQL as shown in the below syntaxSELECT CONCAT(yourColumnName1, ’anyConcatenationString’), CONCAT(yourColumnName2, ’anyC oncatenationString’), ....N from yourTableName;To understand the above syntax, let us first create a table. The query to create a table is as followsmysql> create table selectConcat -> ( -> StudentId int, -> StudentName varchar(100), -> StudentAge int -> ); Query OK, 0 rows affected (1.32 sec)Insert some records in the table using insert command. The query is as followsmysql> insert into selectConcat values(1, 'Carol', 23); Query OK, 1 row affected (0.19 sec) mysql> insert into selectConcat values(2, 'John', 24); ... Read More

PHP hypot() Function

Malhar Lathkar
Updated on 29-Jun-2020 08:59:14

184 Views

Definition and UsageThe hypot() function calculates length of hypotenus of a right angled triangle. Hypoteneuse is calculated as per following formula −h=sqrt(x2+y2) where x and y are other two sides of a right angled triangleFor example, if x=3 and y=4, hypot(x, y)=5 which is equal to sqrt(32+42) = sqrt(25) =5This function always returns a float.Syntaxhypot ( float $x , float $y ) : floatParametersSr.NoParameter & Description1xone side of right angled triangle2yother side of right angled triangleReturn ValuesPHP hypot() function returns length of hypotenuse of a right angled triangle with given values of x and yPHP VersionThis function is available in ... Read More

HTML Cancelable Event Property

Arjun Thakur
Updated on 29-Jun-2020 08:59:07

145 Views

The cancelable event property in HTML checks whether an event is a cancelable event or not. The values include TRUE if it is a cancelable event, else FALSE is returned.Following is the syntax −event.cancelableLet us now see an example to implement the cancelable event property −Example Live Demo    Checking cancelable event    The below button will display whether the event is cancelable or not.    Click me               function myFunction(event) {          var val = event.cancelable;          document.getElementById("myid").innerHTML = val;       }     OutputNow, click on the button to display whether the event is cancelable or not. A boolean value would be returned −

Advertisements