PHP exp() Function

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

163 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

609 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

247 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

HTML Textarea Autofocus Attribute

Arjun Thakur
Updated on 29-Jun-2020 08:45:49

35 Views

The autofocus attribute of the element is used to set the autofocus to the textarea itself when the page loads. The autofocus attribute for the element introduced in HTML5.Following is the syntax −Let us now see an example to implement the autofocus attribute of the element −Example Live Demo Interview Questions Why do you want go for the Technical Writer Job Profile? (100 words)           Write the answer in 100 words only...        What are your strengths? (50 words)           Write the answer in 50 words ... Read More

HTML Input Autofocus Attribute

Chandu yadav
Updated on 29-Jun-2020 08:44:41

114 Views

The autofocus attribute of the element is used to specify which of the would get focus when the web page loads. This attribute introduced in HTML5.Following is the syntax −Let us now see an example to implement the autofocus attribute of the element −Example Live Demo Log in to your account    Id:    Password:    DOB:    Submit OutputIn the above example, we have created a form −    Id:    Password:    DOB:    Submit We have set autofocus to the third input as shown below i.e. DOB, therefore the cursor is visible there itself −DOB:

PHP decoct Function

Malhar Lathkar
Updated on 29-Jun-2020 08:44:20

130 Views

Definition and UsageThe decoct() function returns a string that contains octal equivalent of given decimal number argument.This function returns a string with octal characters (0 to 7).Syntaxdecoct ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent octal representationReturn ValuesPHP decoct() function returns an octal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '1751' −OutputThis will produce following result −decoct(1001) = 1751Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is ... Read More

HTML Textarea cols Attribute

Arjun Thakur
Updated on 29-Jun-2020 08:42:28

26 Views

The cols attribute of the element is used to set the width of the textarea. The cols set it and the width is visible under the textarea itself.Following is the syntax −Above, num is the width of the textarea. The default value is 20.Let us now see an example to implement the cols attribute of the element −Example Live Demo Interview Questions Why do you want go for the Editor Job Profile? (100 words)           Write the answer in 100 words only...        What are your weaknesses? (50 words)     ... Read More

PHP dechex() Function

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

189 Views

Definition and UsageThe dechex() function returns a string that contains hexadecimal equivalent of given decimal number argument.This function returns a string with hexadecimal characters.Syntaxdechex ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent hexadecimal representationReturn ValuesPHP dechex() function returns a hexadecimal number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 1001 and returns '3e9' −OutputThis will produce following result −dechex(1001) = 3e9Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 100.55 is treated as 100 ... Read More

PHP decbin Function

Malhar Lathkar
Updated on 29-Jun-2020 08:40:45

252 Views

Definition and UsageThe decbin() function returns a string that contains binary equivalent of given decimal number argument.This function returns a string with binary digits.Syntaxdecbin ( int $number ) : stringParametersSr.NoParameter & Description1numberA decimal number to be converted in equivalent binary representationReturn ValuesPHP decbin() function returns a binary number inside string.PHP VersionThis function is available in PHP versions 4.x, PHP 5.x as well as PHP 7.x.Example Live DemoFollowing example calculates binary equivalent of 13 and returns '1101' −OutputThis will produce following result −decbin(13) = 1101Example Live DemoFollowing example shows that fractional part of given number is ignored. Hence 9.99 is treated as 9 ... Read More

Function Chaining in JavaScript

vineeth.mariserla
Updated on 29-Jun-2020 08:40:24

4K+ Views

Function chainingFunction chaining is nothing but grouping functions in one single line using dot notation. This type of chaining makes the code very concise and also improves the performance.Here we are going to learn function chaining using regular objects.a) Without function chaining In the following example an object 'obj' is created and in that object a public property called 'i' is created using keyword 'this' and initially assigned a value 0. later on user defined functions called add(), subtract() and print() are created inside the same object 'obj'. Now, the object "obj" will acts like a class(it's properties can be shared by ... Read More

Advertisements