Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8024915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:59:36+00:00 2026-06-04T22:59:36+00:00

i use PHP variables in one of my projects and i have a file

  • 0

i use PHP variables in one of my projects and i have a file named variables.php which stores all the variables value.

<?php
$txt="Hello World!";
$x=16;
?>

I want to create an interface to edit that file’s variables instead of directly editing it in a text editor
By interface, i mean simple text and logical fields….a form. I searched for it but i have no clue from where to start
Can someone give me a clue of what i should be doing to create the mentioned thing.

note: i don’t want to use a database

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T22:59:37+00:00Added an answer on June 4, 2026 at 10:59 pm

    I find it’s easier to use array variables for this purpose and use var_export to store its value inside another .php file.

    $a = array('var' => 'test', 'nr' => 4);
    
    file_put_contents('myvars.php', '<?php return ' . var_export($a, true) . '; ?>', LOCK_EX);
    

    Then to fetch the array again:

    $a = include('myvars.php');
    

    Saving into a .php file has the benefit of speed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In php we use includes. So variables defined in one file and then their
I have these variables that are set in one php file, and when i
I have a php file which connects to a MySql db and read the
I basically use php variables to store the value of the title and the
I'm a bit confused with this: can I use PHP variables in a pg
Somebody said that when your PHP code and application use global variables then it
I have a multiple language website, and I use a php get variable to
i have a variable $cartTotal in cart.php page i want to use that same
One significant drawback of CSS is that one can't use variables. For example, I'd
So far I know two ways to pass php variables to javascript. One is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.