Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts

    Question about variables

    I have been using php for about 12 months and i have never had to declare a variable as either a Interger or String etc, how come i don't have to do this in php when i have used other languages i have always had to declare them first. Y is php different.

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post
    In PHP this is done automatically. PHP does not support explicit type definition in variable declaration. In other languages like c it is required to define before using the variable. It's type is determined in PHP by the context in which that variable is used.

    For Ex.
    If you assign a string value to variable $temp, it becomes a string. If you then assign an integer value to it, it becomes an integer.
    Last edited by harsh789; 05-08-2006 at 01:12 PM.

  • #3
    Regular Coder
    Join Date
    Jan 2006
    Location
    Preston, Lancashire, England
    Posts
    285
    Thanks
    0
    Thanked 0 Times in 0 Posts
    harsh789. On a different note all together where did you get the images for you search button and search header on your site?

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •