problem with subroutines

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swethak
    New Member
    • May 2008
    • 118

    problem with subroutines

    Hi,

    I think that I need subroutines written in another programming language that I can call from PHP to do the following:

    1. Input the directory name and return a list of file names.

    2. Input an HTML file name and return its contents in a string of HTML code.

    3. Input a JPEG file name and return its height and width.

    4. Input a JPEG file name and the desired height and width, and display it at the current point in the output with the given height and width.

    plz give the solution for that and tell the logic for how to start.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    You don't need another programming language for any of that. There are even built in functions for all of this.

    1. glob
    2. file_get_conten ts
    3. getimagesize
    4. This is simple. Simply echo a <img> tag with the proper height, width and src parameters set.

    I would try searching for the functions you need in the manual before you start trying to build your own.
    There are a lot of functions built into PHP. Chances are the one you need already exists.

    Comment

    • nashruddin
      New Member
      • Jun 2008
      • 25

      #3
      Here's a class to fetch a web page, in case your PHP configuration doesn't allow file_get_conten ts() to open URLs.

      Comment

      Working...