Struct in PHP ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • qw12er
    Confirmed User
    • Apr 2004
    • 799

    #1

    Struct in PHP ?

    Why can't I do a Struct in PHP ?

    Why can't I declare 2 classes in the same .php file ? (Works in c++)


    Thanks
    I have nothing to advertise ... yet.
  • Jmonk
    Confirmed User
    • May 2004
    • 115

    #2
    1. Why not just use arrays ?
    2. You can. Don't close and re-open php blocks between class declarations though (<?php ... ?>).

    Comment

    • Logan Videos
      Confirmed User
      • Aug 2005
      • 589

      #3
      Originally posted by qw12er
      Why can't I do a Struct in PHP ?

      Why can't I declare 2 classes in the same .php file ? (Works in c++)


      Thanks
      Theres no struct in PHP, as simple as that. Just make a class and do not add any functions, lol.

      And yes, you can declare 2 classes in the same file.

      Comment

      Working...