SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP Question

  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    NJ
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey y'all. i'm new to PHP and wanted to know if anybody happens to know how to convert a string to an int. i searched php.net and came up empty.

    thanks,
    craig

  2. #2
    SitePoint Wizard silver trophy TheOriginalH's Avatar
    Join Date
    Aug 2000
    Location
    Thailand
    Posts
    4,810
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    craig, you'll get a better answer if you ask here

    H
    ~The Artist Latterly Known as Crazy Hamster~
    922ee590a26bd62eb9b33cf2877a00df
    Currently delving into Django, GIT & CentOS

  3. #3
    SitePoint Zealot cokeman's Avatar
    Join Date
    Dec 2000
    Location
    So. California
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://php.net/manual/en/language.ty...e-juggling.php

    You can cast the string into an int, just like in C

    $int_num = (int) $string_var;

    I agree with TheOriginalH though -- you should ask PHP questions in the PHP forum

  4. #4
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Moved to the appropriate forum
    My 2 Cents (or is that 2.2 Cents including GST?)


Bookmarks

Posting Permissions

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