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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:28:53+00:00 2026-05-13T22:28:53+00:00

I have a products array of widgets. Some widgets have the reserved period symbol

  • 0

I have a products array of widgets.

Some widgets have the reserved period symbol in their names.

The problem occurs when php meets the period, the rest of the widget name is disregarded. How could I read the widget in as a string literal so that the period symbol will not interfere?

unset($products[$widget]);
                  

I could replace the period with a placeholder letter so that it’s not a reserved character, but I’d prefer not to.

  • 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-13T22:28:54+00:00Added an answer on May 13, 2026 at 10:28 pm

    I made some assumptions that were wrong. The widget name’s also contains pound symbols which I lacked to mention because I didn’t know that # symbols effected code the way they do.

    But as it turns out the pound symbol caused the problem after all, but not when using the unset command.

    I passed the widget’s name through the URL using $_GET[‘’]. Apparently the receiving get does not like # symbol and removes everything after pound # symbols.

    Here’s a quick explanination.
    Soo… let’s say I was passing the widget name of “crank#x.55”.
    If I echo’ed the $_GET variable you’d see “crank” and the remaining “#x.55” is stripped off.

    When I looked in the url it showed “crank#x.55” (the full widget name) which lead me to believe that it was sent to the $_GET var correctly. I thought the period (concatination) symbol was doing something screwy when I peformed unset so that is why I created the original question. (i know I need to include more facts for future questions) <– learning process.

    I solved the problem by simply replacing pound symbols with @ symbols and then once the data has been posted convert the @ symbol back to a pound using preg_replace. Similar to pixeline’s answer just adapted a bit for my purpose.

    Thanks

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

Sidebar

Related Questions

I have grid <?php $this->widget('bootstrap.widgets.TbGridView',array( 'id'=>'products-grid', 'htmlOptions'=>array('class'=>'grid-view table-striped',), 'dataProvider'=>$model->search(), 'columns'=>$columns, )); ?> $model->search() return
I have an array of products IDs and I need to find the IDs
I have some code that produces undefined values in an array making no sense.
We have made an xml file for our products and we have a problem.
Possible Duplicate: Output array elements randomly with PHP Lets say we have this code:
how to send array through url in PHP? I have an array of product
I have an array of products $products = array_count_values($products); now I have an array
i have a bit of logical problem here. I have a catalog of products
I have a string: <products type=array> <product><brand>Rho2</brand> <created-at type=datetime>2011-11-03T21:29:46Z</created-at><id type=integer>78013</id><name>Test2</name> <price nil=true/> <quantity nil=true/>
Say I have a Products array in my Mongodb. I'd like users to be

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.