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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:23:25+00:00 2026-06-11T14:23:25+00:00

I have some values in a PHP variable that is the address of customer.

  • 0

I have some values in a PHP variable that is the address of customer. It is passed into the fieldset in html to show on the page.

<fieldset>
            <address><?php echo $_order->getShippingAddress()->getFormated(true) ?></address>
</fieldset>

I want to get each value in the set into a javascript variable. How can I do that?

<?php $_ad = $_order->getShippingAddress()->getFormated(true);?>

I want the values from $_ad into the javascript variable. I have tried to do so but i can only get one index like $_ad[0]. that gives only one alphabet!!!

Here is what I have tried,

val =  '<?php echo $_ad[0] ;?>';
  • 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-11T14:23:26+00:00Added an answer on June 11, 2026 at 2:23 pm

    Since javascript is evaluated on the client side and php on the server side, there is no direct way to interact or exchange variables.

    You can either expose a webservice that you can then access from javascript via an ajax call. Or you could just parse the data from the page, since you know for sure, that there will be a fieldset with a address inside it. Use jQuery and try something like this:

    var addresses = $("address").map(function() { return [this.innerHTML.split("<br>")]; });
    

    jsFiddle for that

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

Sidebar

Related Questions

I have php code that puts some values into an Array as follows: $hunter=addslashes($MessageArray[1]);
hi have a php template that displays an html page. in it there is
I have a php variable with some html content, and some href links. I
Here I have a simple php script which displays some values from a database
In my C++ application, I have some values that act as codes to represent
I have some code that sets up a dictionary with some defualt values for
I have some jquery that inputs text into a database and then clears the
i have a shadow box in my page , and im passing some values
I am writing a web page in PHP that will provide some useful tools
I have a form that posts some data to a PHP processing script. I

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.