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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:03:59+00:00 2026-06-06T17:03:59+00:00

I have an Array like below in PHP array( (int) 0 => array( ‘id’

  • 0

I have an Array like below in PHP

array(
    (int) 0 => array(
        'id' => '1',
        'name' => 'Mink7',
        'about' => 'Creative Design agency',
        'logo' => null,
        'lat' => '13.004870000000',
        'lng' => '77.576686084656'
    ),
    (int) 1 => array(
        'id' => '2',
        'name' => 'Bakasura',
        'about' => 'Live 2 Eat',
        'logo' => null,
        'lat' => '13.005643569006',
        'lng' => '77.577485382942'
    )
)

What have i done.
I load the Function in the Header and have written the following in the body tag.

<script type="text/javascript">
$(document).ready(function(){
        var startups = <?php echo json_encode($startups); ?>;
        $.each(startups, function(key, val) {
            markMe(val.lat, val.lng, val.name, val.description, val.logo);
        });
});
</script>

I am getting the following error

markMe is not defined

markMe(val.lat, val.lng, val.name, val.description, val.logo);

Javascript File that is attached to HEAD.

// JavaScript Document
$(document).ready(function () {
    var map = new GMaps({
        div: '#map',
        lat: 13.00487,
        lng: 77.576729,
        zoom: 13,
    });

    /*
    GMaps.geolocate({
        success: function (position) {
            map.setCenter(position.coords.latitude, position.coords.longitude);
        },
        error: function (error) {
            alert('Geolocation failed: ' + error.message);
        },
        not_supported: function () {
            alert("Your browser does not support geolocation");
        },
        always: function () {
            //alert("Done!");
        }
    });
    */

    map.addControl({
        position: 'top_right',
        text: 'Geolocate',
        style: {
            margin: '5px',
            padding: '1px 6px',
            border: 'solid 1px #717B87',
            background: '#fff'
        },
        events: {
            click: function () {
                GMaps.geolocate({
                    success: function (position) {
                        map.setCenter(position.coords.latitude, position.coords.longitude);
                    },
                    error: function (error) {
                        alert('Geolocation failed: ' + error.message);
                    },
                    not_supported: function () {
                        alert("Your browser does not support geolocation");
                    }
                });
            }
        }
    });

    map.addMarker({
        lat: 13.00487,
        lng: 77.576729,
        title: 'Lima',
        icon: "http://i.imgur.com/3YJ8z.png",
        infoWindow: {
          content: '<p>HTML Content</p>'
        }
    });

    function markMe(lat, lng, name, description, logo){
        map.addMarker({
            lat: lat,
            lng: lng,
            title: name,
            icon: "http://i.imgur.com/3YJ8z.png",
            infoWindow: {
              content: description
            }
        });
    }

});
  • 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-06T17:04:00+00:00Added an answer on June 6, 2026 at 5:04 pm

    look for json_encode in PHP, and use JSON.parse in JavaScript (or a library like jQuery.parseJSON if you need broad browser support)

    — after update

    instead of
    function markMe(lat, lng, name, description, logo){

    do:
    markMe = function (lat, lng, name, description, logo){

    that’s because a function declared in a function is not availlable outside that function

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

Sidebar

Related Questions

i have an array like below int[] array = new array[n];// n may be
I have an array in PHP with URLs like below: http://example.com/apps/1235554/ http://example.com/apps/apple/ http://example.com/apps/126734 http://example.com/images/a.jpg
I have a form to upload image like below <form name=sample enctype=multipart/form-data action=index.php method=post
I have a PHP array like below: Array ( [0] => 16 [1] =>
I have an array structure like below array { [0]=> { [name] = maulik;
I have a large multidimensional array structured like the sample below. [ ['name' =>
I have an php array like below: Array ( [0] => Array ( [value]
I have an array of array like below with all numeric values. I want
I have an array,something like below MutableArray ( { a = 1; b =
I have a JSON array like below: var jsonArray = [{k1:v1},{k2:v2},{k3:v3},{k4:v4},{k5:v5}] I don't know

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.