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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:50:52+00:00 2026-05-25T23:50:52+00:00

Im not to familiar with php. I am posting from a form and my

  • 0

Im not to familiar with php.

I am posting from a form and my php looks like this :

// Object syntax looks better and is easier to use than arrays to me
    $post = new stdClass;

    // Usually there would be much more validation and filtering, but this
    // will work for now.
    foreach ($_POST as $key => $val)
        $post->$key = trim(strip_tags($_POST[$key]));

On the form I have fields like Fist Name, Last Name , Address, Zip, City, State etc.

The information will displayed in a table on my next page (for example) with:

<?php echo $post->name; ?>

since I am using the object syntax.

If I want the cell that displays the address to combine the full address do I write it like this:

<?php echo $post->address, city, state, zip; ?>

I basically would like to show the address as an address would normally be displayed (e.g. 123 This street, City, AZ, 55555)

Ideally, it would be comma separated as an address would be written. So I am sure I am not do this correctly right now.

  • 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-05-25T23:50:53+00:00Added an answer on May 25, 2026 at 11:50 pm

    Try this:

    <?php echo htmlspecialchars("{$post->address}, {$post->city}, {$post->state}, {$post->zip}"); ?>
    

    The curly braces allow you to enclose PHP object references within a string (rather than having to use concatenation).

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

Sidebar

Related Questions

I've been battling with this for a while, I'm not familiar with PHP syntax,
I'm not familiar with this programming language,in PHP it's getcwd() .
I am not familiar with this, and can use a kick start. I am
Seeking suggestions from PHP architects! I'm not terribly familiar with PHP but have taken
Should be a simple question, I'm just not familiar with PHP syntax and I
I am not familiar with PHP at all and had a quick question. I
I am not familiar with this website but I am desperately seeking help with
I'm not familiar with ADO.NET Data Services but it looks usable. All I need
I am not familiar with Ivy. I think this is some utility to automatically
I'm not familiar with FragmentPagerAdapter , so this is going to be one of

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.