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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:47:55+00:00 2026-06-14T06:47:55+00:00

I have a function written by someone else which returns the address of a

  • 0

I have a function written by someone else which returns the address of a customer. This function isn’t as simple as you would have thought it might need to be. For a good reason it has been written so that the return variable goes through:

eval("\$address_out = \"$fmt\";");

first. And despite a quick look in the manual just what it does it a mystery to me. So the problem is the address is returned like these two examples (note on has 3 repeating <br/>s and the other 4)

ginger rogers<br /> hollywood<br /> California<br /> <br /> <br /> United states

ginger rogers<br /> hollywood<br /> <br /> <br /> <br /> United states

I thought it would be quicker to just strip the repeating <br/>s out but I’m confused because there can be a different amount of them and they are seperated by spaces.

Anyone any ideas?

EDIT: I should have said, I want to keep one of the
between each bit of the address, it’s where there are multipul
I want to get rid of all but one

  • 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-14T06:47:56+00:00Added an answer on June 14, 2026 at 6:47 am

    $addr = str_replace( array( '<br/>', '<br>', '<br />', "\r", "\n" ), '', $addr ); will remove <br/> breaks, plus new line and carriage return characters.

    To maintain one <br/> still:

    while ( strpos( $addr, '<br /> <br />' ) !== false ) { 
        // while two adjoining <br />'s still exist in the variable
        // replace two with one <br /> break
        $addr = str_replace( '<br /> <br />', '<br />', $addr );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this line of code in MATLAB, written by someone else: c=a.'/b I
I have a 3500 lines long C function written by someone else that i
I have some code written by someone else in which some functions take arguments
I have the following function that was written by someone else, however I am
I have a function written in Java which accepts varargs as an argument. I
I have a function written in C# which has one parameter type as Dictionary<string
I have written this function to auto correct gender to M or F from
I have written a function which warn a user before refreshing the (I require
I have written this innocent javascript code, which lets the user create two markers
I have to modify a project written by someone else. Because the code 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.