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

  • Home
  • SEARCH
  • 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 6666205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:48:14+00:00 2026-05-26T02:48:14+00:00

hi i am trying to use dynamic array name . but when i run

  • 0

hi i am trying to use dynamic array name . but when i run this code i get the error $marker is undefined .

 if (isset($arr)) {
               foreach ($arr as $key => $value) {

                  $marker.$key = array();

                   $marker.$key ['position'] = $value['lat'] . ',' . $value['long'];
                   $marker.$key ['draggable'] = 'TRUE';
                   $marker.$key ['ondragend'] = "test(this.getPosition().lat(),this.getPosition().lng())";

                   $this->ci->googlemaps->add_marker($marker.$key);
                   $i++;
                  }

           }

how can i create dynamic array name ????

  • 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-26T02:48:15+00:00Added an answer on May 26, 2026 at 2:48 am

    Read The Fine Manual. The dot operator in PHP is completely unrelated to the dot operator in Javascript and similar languages – it does string concatenation. I don’t quite understand what it is you’re trying to do, but I’m fairly sure string concatenation is not it.

    To clarify, what this does:

    $marker.$key ['draggable'] = 'TRUE';
    

    …is this;

    • get the value in $marker, interpret it as a string
    • get the value in $key, interpret it as a string
    • concatenate $marker and $string
    • interpret the resulting string as an array, and set the element at ‘draggable’ to the string (!) ‘TRUE’. I’m not even sure what this does – string do allow for array-style indexing (which references individual characters), but I have no idea what non-integer indexes would yield.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to use this code to connect the AD PrincipalContext context = new PrincipalContext(ContextType.Domain,
I am trying to use memset to set a dynamic array of size rownum
In my code, I am trying to create a dynamic array with initArray function,
I am trying to get a stringArray resource with this code: String continent =
I am trying to use the ASP.NET Dynamic Data features to generate CRUD scaffolding
I was trying use a set of filter functions to run the appropriate routine,
Trying to use a guid as a resource id in a rest url but
Trying to use this method (gist of which is use self.method_name in the FunnyHelper
VBA newbie over here. I'm trying to use an array formula through excel vba
I'm trying to figure out how to de-reference a value in an array but

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.