Are there scanf and fprintf in PHP 5?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • RC

    Are there scanf and fprintf in PHP 5?

    I looked at that O'Reilly book Programming PHP
    by Rasmus Lerdorf and Kevin Tatroe. That book
    base on PHP 4. From Appendix A.
    I could find

    fscanf
    printf

    But where are

    scanf
    fprintf

    sscanf
    sprintf

    Are those four available in PHP 5, now?
    Thank Q!
  • Andy Hassall

    #2
    Re: Are there scanf and fprintf in PHP 5?

    On Wed, 11 May 2005 16:32:15 -0400, RC <raymond.chui@n ospam.noaa.gov> wrote:
    [color=blue]
    >I looked at that O'Reilly book Programming PHP
    >by Rasmus Lerdorf and Kevin Tatroe. That book
    >base on PHP 4. From Appendix A.
    >I could find
    >
    >fscanf
    >printf
    >
    >But where are
    >
    >scanf
    >fprintf
    >
    >sscanf
    >sprintf
    >
    >Are those four available in PHP 5, now?[/color]

    PHP has a manual that you can search.

    In fact one of my favourite features of the PHP site is you can just put:

    php.net/something_you_t hink_might_be_a _function

    ... into your browser, and the site (a) redirects you to a local mirror, (b)
    takes you straight to the manual page for the function if it exists or (c)
    shows close matches or offers a Google search on the site if it doesn't match.

    Fantastic.

    So:

    PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.

    Write a formatted string to a stream

    Parses input from a string according to a format



    I use sprintf liberally in PHP4 - it's been there for a long time. It's still
    there in PHP5.

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Ken Robinson

      #3
      Re: Are there scanf and fprintf in PHP 5?


      RC wrote:[color=blue]
      > I looked at that O'Reilly book Programming PHP
      > by Rasmus Lerdorf and Kevin Tatroe. That book
      > base on PHP 4. From Appendix A.
      > I could find
      >
      > fscanf
      > printf
      >
      > But where are
      >
      > scanf
      > fprintf
      >
      > sscanf
      > sprintf
      >
      > Are those four available in PHP 5, now?[/color]

      The best place to look for answers to questions like these is at
      PHP is a popular general-purpose scripting language that powers everything from your blog to the most popular websites in the world.


      Just enter www.php.net/sprintf (or any function) and you will be taken
      to that function if it exists.

      Ken

      Comment

      Working...