Writing objects to a binary file

Discussion in 'PHP' started by shubhamjain1, Aug 8, 2009.

  1. #1
    In C++, we can write objects to a binary file using read and write functions. Can we do that in PHP too?
     
    shubhamjain1, Aug 8, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Well, you can serialize() and unserialize objects to write them to text files.
     
    premiumscripts, Aug 8, 2009 IP
  3. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #3
    fread/frwrite functions are also binary safe in PHP.
     
    ThePHPMaster, Aug 8, 2009 IP