Web Development
Member Avatar

Hi all,

In PHP just wondering if anyone knows whether one method of creating multiple indexes within an array is more efficient / preferable to another?

`

$listing['one'] = $x; …
Web Development
Member Avatar

Hi all,

In PHP just wondering if anyone knows whether one method of creating multiple indexes within an array is more efficient / preferable to another?

`

$listing['one'] = $x; …
Topic by James_43

Hi James,

I think your second listing should actually be coded:-

$listing = [
    'one' => $x,
    'two' => $y,
    'three' => $z
];
Web Development
Member Avatar

Hi all,

I am aiming to create an array with the same structure as this:

Array
(
    [798D25C0DEABD] => Array
        (
            [quantity] => 1
        )

    [40B2B0FA3D222] => Array
        (
            [quantity] …
Web Development
Member Avatar

Hi all,

I am aiming to create an array with the same structure as this:

Array
(
    [798D25C0DEABD] => Array
        (
            [quantity] => 1
        )

    [40B2B0FA3D222] => Array
        (
            [quantity] …
Topic by James_43

Hi,

Try not to use for loops to iterate an array. I'm not sure what you are trying to achieve, but i've constructed similar data and looped through it. Hope …

Web Development
Member Avatar

Hi all,

I have a fairly limited understanding of how objects work exactly, but basically I have:

$response[] = $html->data->identifier;

Which I would think stored the values as an array, …

Topic by James_43

Just noticed the inner $key should be $key2

php
Web Development
Member Avatar

Hi all,

I have a fairly limited understanding of how objects work exactly, but basically I have:

$response[] = $html->data->identifier;

Which I would think stored the values as an array, …

php
Web Development
Member Avatar

Hi all,

I have a fairly limited understanding of how objects work exactly, but basically I have:

$response[] = $html->data->identifier;

Which I would think stored the values as an array, …

Topic by James_43

Hi James,

$response[] = will create (if it doesn't exist) or append the right-hand value to the $response array. So if $html->data->identifier is a simple string, e.g. 'Price', then a …

php
Web Development
Member Avatar

Hello Guys.... Im a first year student in web coding.
Im making my exam project right now and i really need you guys help for this simple thing :D.
In …

Topic by Firmace

Hi diafol,

I think that is a personal preference. I myself prefer to use the alternative PHP syntax and simply output PHP variables inline.

Web Development
Member Avatar

Hello Guys.... Im a first year student in web coding.
Im making my exam project right now and i really need you guys help for this simple thing :D.
In …

Web Development
Member Avatar

Hello Guys.... Im a first year student in web coding.
Im making my exam project right now and i really need you guys help for this simple thing :D.
In …

Topic by Firmace
<style>.selected {background: yellow}</style>
<?php 

$menu[] = array('menu_id' => 1, 'menu_text'  => 'Home');
$menu[] = array('menu_id' => 2, 'menu_text'  => 'Service');
$menu[] = array('menu_id' => 3, 'menu_text'  => 'About Us');
$menu[] …
Web Development
Member Avatar

Hi all,

I'm not too familiar with Ajax but I believe I grasp the basics. So I'm sending an id which I retrieve from an element to a php page …

Topic by phfilly

Hi,

Sorry for the delay in replying. Can you describe in a non-technical way what it is that you are wanting to achieve?

Web Development
Member Avatar

Hi all,

I'm not too familiar with Ajax but I believe I grasp the basics. So I'm sending an id which I retrieve from an element to a php page …

Topic by phfilly

This type of id?

<img id="457" src="image.png">
Web Development
Member Avatar

Hi all,

I'm not too familiar with Ajax but I believe I grasp the basics. So I'm sending an id which I retrieve from an element to a php page …

Web Development
Member Avatar

Hi all,

I'm not too familiar with Ajax but I believe I grasp the basics. So I'm sending an id which I retrieve from an element to a php page …

Topic by phfilly

What is part ? is it a string of html or a numeric ?

UI / UX Design
Member Avatar

Hi guys,

I change my code from Javascript to jQuery and I believe I have everything allright, but my jQuery is not showing the value. Can you help me with …

Topic by gcardonav

I've created a small piece of code based on yours, but without the frills, for you to review.

http://jsfiddle.net/z04bpvky/1/

UI / UX Design
Member Avatar

Hi guys,

I change my code from Javascript to jQuery and I believe I have everything allright, but my jQuery is not showing the value. Can you help me with …

UI / UX Design
Member Avatar

Hi guys,

I change my code from Javascript to jQuery and I believe I have everything allright, but my jQuery is not showing the value. Can you help me with …

Topic by gcardonav

Hi,

.val() is for form values. you need to use .text()