Jump to content

Writing new code using old variables..


Blunketts dog

Recommended Posts

Hi there,

 

I am having difficulty using one php file to write to another php file that contains the variable from the first file.

 

As an example, say I have the following code (original.php) to create a new file:

 

<?php

$name = Joe

touch ("$name.php");

>?

 

Is there a way of writing to the new file (Joe.php) so that Joe.php would be this:

 

<?php

echo "hello Joe"

?>

 

but without referencing original.php file.

 

What I am trying to do is loop through a list of names that creates a new php file for each name that is specific to that person. However the original.php may have been deleted before joe.php is run.

 

I hope that makes sense?????

 

Thanks in advance

 

Link to comment
https://forums.phpfreaks.com/topic/146500-writing-new-code-using-old-variables/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.