Array becomes unset by itself?


Posted on 16th Feb 2014 07:03 pm by admin

Hi,

I have a bit of experience with PHP but not extensive. It seems I cannot store any items to the array $details.

Did you know?Explore Trending and Topic pages for more stories like this.
The class:

class Newsletter {
public $details = array();

function Newsletter($id) {
$details['id'] = $id;
echo "From same function: " . $details['id'];

$this->Load();
}

function Load() {
echo "From sibling function: " . $details['id'];
}
}

The call from the webpage:

$x = new Newsletter(123);
//output
From same function: 123
From sibling function:

Is there a special way to interact with the array so that it sticks for use with other functions?

Thanks
No comments posted yet

Your Answer:

Login to answer
217 Like 20 Dislike
Previous forums Next forums
Other forums

Change of partner analyse in sales orders
Hello,

I changed the partner analyse for sales orders and added a new mandatory partnerro

Javascript or not?
How many people prefer javascript/ajax sites? How many prefer the good old fashion straight php sit

how to hide input fields on selection screen using variant attribute
Hello all,

I want to know how to hide input fields on selection screen using variant attr

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

IP question
ive got 2 ip addresses both global from same user how would i detect if they are local to each other

newbie error
what is wrong with this code ?

<html>
<body>

<?

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

Creating an invoice
Using fpdf I am trying to create an invoice to send to clients. The products are sold in pricing tie

how to get different value in second view of webdynpro?
hello guys,

In ABAP webdynpro I am trying to create one application having two views.

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash