The MU forums have moved to WordPress.org

Make 2 variables from 1 (4 posts)

  1. maka1
    Member
    Posted 15 years ago #

    Guys, does anybody know how to make 2 variables from 1.

    Here is an example, i have a variable "X" in my database

    which returns this: "10.20" (when doing "echo $wpdb->x")

    how do i separate "10" and "20" into 2 other variables?

    like that:

    $wpdb->x = $id1 . '.' . $id2;

    so that now

    $id1 equals 10, and $id2 equals 20.

    so "echo $id1" should return 10, while "echo $id2" should return 20,

    but this doesnt work, why? :)

    (sorry for a vague explanation, dont know how to explain this properly

  2. lunabyte
    Member
    Posted 15 years ago #

  3. maka1
    Member
    Posted 15 years ago #

    tnx, will read it :)

  4. maka1
    Member
    Posted 15 years ago #

    cool, it worked, cheers!

About this Topic