Function inside function?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
popokolok
Forum Newbie
Posts: 1
Joined: Wed Jan 14, 2009 10:00 am

Function inside function?

Post by popokolok »

Hello, I have this code:

Code: Select all

$lol=file_get_contents('http://www.website.com/something/print $page;');
 
print $lol;
$page should fetch a random filename from an array defined earlier in the code whenever the page is refreshed, to complete the url for file_get_contents. For example: http://www.website.com/something/spoon.html

How can I make the print function to work inside the file_get_contents as shown above? Do I need to escape some characters or something?

Thanks in advance!
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Re: Function inside function?

Post by kendall »

try

Code: Select all

file_get_contents('http://www.website.com/something/print '.$page);
Post Reply