|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
Hello,
If I have variable names in a text file how can I use those names as variables? I have "cont" as a string in a file. That is read in using fopen. How can I use $cont as my variable? |
| Sponsored Links |
|
|
|
|||||
|
I believe when you use fopen, the entire content of the file is stored as a string. Therefor you would need to use some method to parse the content. Either using regex or some string functions such as sscanf.
|
|
|||
|
Yes, I need the variable name to be the array. I suppose I could use an array but it is just easier when going through the list again to say print $variable instead of finding the name and searching an array.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] Long names for Category title and Name | julial | ionFiles | 5 | 07-26-2007 09:58 AM |
| Using input to change a variable? | Plutonic | Java Help | 3 | 07-17-2007 05:02 PM |
| Free Domain Names | techni68 | Hosting and Registrars | 10 | 03-04-2007 10:12 AM |
| Java:Tutorial - The Variable | John | Java Tutorials | 0 | 12-09-2006 10:59 AM |
| Variable to Debug Window | Void | C# Programming | 3 | 07-04-2006 09:26 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 98%