#1

  1. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Post Is Exponential Value is String? How? Logical Question


    I used two types of codes. here. integer value is printing string type each time. why?

    PHP Code:
    $name1 "10e10";
    var_dump($name1); 
    its output defiantly shows : string => 10e10

    but when I use :

    PHP Code:
    $name1 10e10;
    var_dump($name1); 
    it also shows : String => 10000000000

    it is digit

    how is this possible?
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,984
    Rep Power
    9397
    It is not possible according to the code you posted.

    What is your actual code?

    Comments on this post

    • Strider64 agrees : $name1 = 10e10; // results is float(100000000000) when var_dump is done.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2012
    Location
    Burb of Detroit, Michigan
    Posts
    86
    Rep Power
    76
    Here's a simple online website where you can test snippets of php code: http://writecodeonline.com/php/
  6. #4

  7. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Lightbulb working perfect


    Originally Posted by requinix
    It is not possible according to the code you posted.

    What is your actual code?
    sorry at that time , it was giving error, now it is working fine. i delete my system cookies.

    PHP Code:
    <?php
    $name1 
    "10e10";
    var_dump($name1);
    echo 
    "<br />"
    $name1 10e10;
    var_dump($name1); 
    ?>
  8. #5

  9. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Thumbs up wow


    Originally Posted by Strider64
    Here's a simple online website where you can test snippets of php code: http://writecodeonline.com/php/
    WOW great site friend

    I book mark it and i'll use it in future. mostly I am using wampserver but due to system cache we get error.

    thanks for it.
  10. #6

  11. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    Originally Posted by requinix
    It is not possible according to the code you posted.

    What is your actual code?
    can you please tell me how can i change my avatar on this forum.

    I checked that option is not available.
  12. #7
  13. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Would you please stop claiming that "there was an error" without saying what error it was? We don't have access to your PC, and we cannot read your mind. This means you have to actually tell us what's happening.

    Simply copy the error message or output and paste it into your post. Then we can see the actual result and not your personal interpretation of it.

    Your code

    PHP Code:
    $name1 10e10;
    var_dump($name1); 
    does not and will never yield "String", because 10e10 is a float, not a string. You must have looked at the wrong output.

    Put this into an empty .php file and then run it:

    PHP Code:
    <?php

    $name1 
    10e10;
    var_dump($name1);
    You'll see
    Code:
    float 100000000000
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  14. #8

  15. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    Red face Sorry


    Originally Posted by Jacques1
    Simply copy the error message or output and paste it into your post. Then we can see the actual result and not your personal interpretation of it.
    Sorry sir, from next time. i'll take care of it.

    Comments on this post

    • Jacques1 agrees
  16. #9
  17. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Posts
    3,957
    Rep Power
    1046
    Originally Posted by same2cool
    i'll take care of it.
    Cool.

    By the way, no need to call us "sir" or even "dear". "sir" is a very formal way of addressing somebody. You might say that to your boss. And "dear" is what you say to a loved one. Both isn't really appropriate here.

    Just use the nickname or leave out the salutation altogether.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".
  18. #10

  19. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    Originally Posted by Jacques1
    Just use the nickname or leave out the salutation altogether.
    I use it.
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    Originally Posted by Jacques1
    Cool.

    By the way, no need to call us "sir" or even "dear". "sir" is a very formal way of addressing somebody. You might say that to your boss. And "dear" is what you say to a loved one. Both isn't really appropriate here.

    Just use the nickname or leave out the salutation altogether.
    I think it is a cultural thing, he might be from asia or therabouts.
  22. #12

  23. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1
    Originally Posted by paulh1983
    I think it is a cultural thing
    I am from South Asia (Pakistan)
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Dec 2004
    Posts
    2,971
    Rep Power
    375
    Originally Posted by same2cool
    I am from South Asia (Pakistan)
    ok dear

    me too. Well my background from there but not currently residing there.
  26. #14

  27. Join Date
    Sep 2013
    Location
    Lahore, Pakistan
    Posts
    74
    Rep Power
    1

    good


    Originally Posted by paulh1983
    ok dear

    me too. Well my background from there but not currently residing there.
    that is great; so you are Muslim ? and nice to meet you here.

IMN logo majestic logo threadwatch logo seochat tools logo