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 8728035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:32:56+00:00 2026-06-13T08:32:56+00:00

I have a JS library file of variables (caption strings) used by server-side JavaScript.

  • 0

I have a JS library file of variables (caption strings) used by server-side JavaScript. Can I read/interpret that from PHP?

The path to the data isn’t the issue, but whether PHP can read/use the JS variables. Currently I’ve the same variable stored in both a JS file and PHP include with obvious scope for changes getting out of synch. I’ve tried reading the PHP from the server-side JS without joy but was wondering if – with suitable parsing – if PHP could extract/use the JS variables.

I repeat all data involved is server-side on the same server. Sorry if I’ve missed this being answered before but PHP/JS questions are (even if mis-titled) seemingly all about passing data between client and server side processes – which isn’t my scenario.

Later – clarification:

The s/s JavaScript is part of a web interface to an image database where I can’t alter the API. It doesn’t support creating emails (for file requests) thus I am having to do that via PHP. Work scope/budget precludes re-writing a new d/b interface, rather we ‘just’ ned to be able to send an email. IOW, I realise you wouldn’t choose to be trying to do this if starting from scratch! Also, I don’t think I can do s/side AJAX to fetch variables or do PHP smtp mail as the JS environment seemingly isn’t designed for that degree of s/s processing pre HTML page delivery.

  • 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-13T08:32:57+00:00Added an answer on June 13, 2026 at 8:32 am

    It sounds like you have config values (ie the captions) in the JS code.

    If you want to keep it this way, my suggestion would be to split the config itself into a discrete .JS file, which would contain just the variable definitions but no actual JS code.

    Then you should be able to simply parse it in PHP using json_decode(). Job done.

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

Sidebar

Related Questions

I have a jar library. I used Java Class File Editor (CE) to modify
I was given an static library (.a extension file) that I have to use
I have an ASP.NET application that uses a custom .NET library (a .DLL file).
I have an include file with 100+ global variables. It's being used in a
I have a string stored in a file that is read into a string.
Yet another static question. I have read the following: What are static variables? file
Is there any PHP PDF library that can replace placeholder variables in an existing
I have problems using variables from library modules in IntellliJ IDEA 11. My steps
PostgreSQL seems to have an environment file that allows settings environment variables. On Linux
I have a library project which includes a object (.o) file. I have the

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.