Grab function in different file.

Discussion in 'PHP' started by !nfamous, Dec 3, 2008.

  1. #1
    I have a function ( or whatever you call it ) in (site)/home.php ( its $stats ) and i'm wanting it on themes/themename/layout.php

    How could i do this?
     
    !nfamous, Dec 3, 2008 IP
  2. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #2
    if your site (file) tree like this
    
    -site/home.php
    -site/themes/themename/layout.php
    
    Code (markup):
    put this line on your layout.php file, before you call your function.
    include ('../../home.php');
    PHP:
     
    misbah, Dec 3, 2008 IP