-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

Showing posts with label PHP 7 Tutorial HyperText Preprocessor. Show all posts
Showing posts with label PHP 7 Tutorial HyperText Preprocessor. Show all posts
  • PHP random numbers


    PHP random numbers



    PHP Random Numbers


    The rand() function is used in PHP to generate a random integer. The rand() PHP function can also be used to generate a random number within a specific range, such as a number between 10 and 35.

    If no max limit is specified when using the rand() PHP function, the largest integer that can be returned is determined by the getrandmax() function, which varies by operating system.  PHP random numbers



    Random Number Syntax :

    rand();

    or

    rand(min, max);


    Random Numbers :

    The rand() funciton generates a random number:


    Example 


    echo (rand(10,35));

    echo "<br>";

    echo (rand(1, 100000));

    echo "<br>";

    echo (rand());


    ?>



    </body>
    </html>



    As you can see in these examples, the first rand function generates a random number between 10 and 30, the second between 1 and 1 million, and then third without any maximum or minimum number defined.




    11
    18804
    367545283







    Video on This Topic :- Soon




    I hope you liked this post, then you should not forget to share this post at all.

    Thank you so much :-)


  • PHP casting strings and floats to integers


    PHP casting strings and floats to integers


    PHP Numbers


    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.


    PHP Casting Strings and Floats to Integers


    Sometimes you need to cast a numerical value into another data type.

    The (int), (integer), or intval() function are often used to convert a value to an integer.


    Example


    Cast float and string to integer:



    Example 

    $x = 437.2453;
    $int_cast = (int)$x;
    echo $int_cast;


    echo "<br>";


    // Cast string to int

    $xx = "232.268";
    $int_cast = (int)$xx;
    echo $int_cast;




    ?>



    </body>
    </html>




    437
    232

    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )



  • PHP numbers with NaN


    PHP numbers with NaN



    PHP Numbers

    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.


    PHP NaN


    NaN stands for Not a Number.

    NaN is used for impossible mathematical operations.

    PHP has the following functions to check if a value is not a number:


    • is_nan()


    However, the PHP var_dump() function returns the data type and value:

    Example

    Invalid calculation will return a NaN value:


    Example 

    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP numbers with NaN </title>

    </head>
    <body>

    <h1> </h1>


    <?php

    //  check if the type of a variable is integer

    $x = acos(8);

    var_dump($x);

    ?>


    </body>
    </html>





    flaot(NaN)


    NOTE :- From PHP 7.0: The is_numeric() function will return FALSE for numeric strings in hexadecimal form (e.g. 0xf4c3b00c), as they are no longer considered as numeric strings.

    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )



  • PHP numbers with numerical strings


    PHP numbers with numerical strings




    PHP Numbers

    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.


    PHP Numerical Strings


    The PHP is_numeric() function can be used to find whether a variable is numeric. The function returns true if the variable is a number or a numeric string, false otherwise.

    Example


    Check if the variable is numeric:



    Example 

    <html>

    </head>
    <body>


    <?php

    // Check if the variable is numeric   

    $x = 5985;
    var_dump(is_numeric($x));


    echo "<br>";


    $y = "5985";
    var_dump(is_numeric($y));


    echo "<br>";


    $z = "59.85" + 100;
    var_dump(is_numeric($z));


    echo "<br>";


    $xx = "Hello";
    var_dump(is_numeric($xx));

    ?>


    </body>
    </html>





    bool(true)
    bool(true)
    bool(true)
    bool(false)



    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )











  • PHP numbers with infinty


    PHP numbers with infinty


    PHP Numbers

    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.


    PHP Infinity


    A numeric value that is larger than PHP_FLOAT_MAX is considered infinite.

    PHP has the following functions to check if a numeric value is finite or infinite:

    • is_finite()
    • is_infinite()

    However, the PHP var_dump() function returns the data type and value:


    Example

    Check if a numeric value is finite or infinite:





    Example 

    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP numbers with infinty </title>

    </head>
    <body>

    <h1> </h1>


    <?php

    //  check if the type of a variable is integer

    $x = 1.9e41121;
    var_dump($x);

    ?>


    </body>
    </html>





    flaot(INF)



    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )



  • PHP numbers with floats


    PHP numbers with floats

    PHP Numbers

    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.

    PHP Floats


    A float is a number with a decimal point or a number in exponential form.

    2.0, 256.4, 10.358, 7.64E+5, 5.56E-5 are all floats.

    The float data type can commonly store a value up to 1.7976931348623E+308 (platform dependent), and have a maximum precision of 14 digits.

    PHP has the following functions to check if the type of a variable is float:


    • is_float()
    • is_double() - alias of is_float()


    Example

    Check if the type of a variable is float:



    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP numbers with floats </title>

    </head>
    <body>

    <h1> </h1>


    <?php

    //  check if the type of a variable is integer
    $x = 574.92;
    var_dump(is_float($x));

    echo "<br>";

    // check again

    $z = 542;
    var_dump(is_float($z));



    ?>


    </body>
    </html>





    bool(true)
    bool(false)




    NOTE :- Video on This Topic :- Soon




    Have a Nice Stay Here : - )



  • PHP numbers with integers


    PHP numbers with integers

    PHP Numbers


    You must have noticed one thing that whenever we take the numbers in the identification, then its conversion becomes automatic Or we can say that whatever number we give through Varible, the data type of the number is automatically correct according to its data type.Then, if you assign a string to the same variable, the type will change to a string. PHP numbers with integers

    This automatic conversion can sometimes break your code.


    PHP Integers

    An integer is a number without any decimal part.

    2, 256, -256, 10358, -179567 are all integers. While 7.56, 10.0, 150.67 are floats.


    So, an integer data type is a non-decimal number between -2147483648 and 2147483647. A value greater (or lower) than this, will be stored as float, because it exceeds the limit of an integer.

    Another important thing to know is that even if 4 * 2.5 is 10, the result is stored as float, because one of the operands is a float (2.5).



    Here are some rules for integers:



    • An integer must have at least one digit
    • An integer must not have a decimal point
    • An integer can be either positive or negative
    • Integers can be specified in three formats: decimal (10-based), hexadecimal (16-based - prefixed with 0x) or octal (8-based - prefixed with 0)


    PHP has the following functions to check if the type of a variable is integer:



    • is_int()
    • is_integer() - alias of is_int()
    • is_long() - alias of is_int()


    Integer Data Type Check 


    Example 

    <!DOCTYPE html>
    <html>
    <head>

    <title> PHP numbers with integers </title>

    </head>
    <body>

    <h1> </h1>


    <?php

    //  check if the type of a variable is integer
    $x = 574892;
    var_dump(is_int($x));

    echo "<br>";

    // check again

    $z = 54.2;
    var_dump(is_int($z));



    ?>


    </body>
    </html>





    bool(true)
    bool(false)



    NOTE :- Video on This Topic :- Soon





    Have a Nice Stay Here : - )


  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.