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.

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

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Call db table from any PHP file
Hi,

I want to be able to call a database table that will be setup in another file called init

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

List/Menu Box
On an edit page when you want something to select what a user has previously selected from the datab

b+ tree
Hi
can every body help me about b+ tree ?(insert & delete)

foreach result into a single variable
Hi,

I have this code...

Code: [Select]foreach ($_POST['Interests'] as $interest =&

tell csv import script to ignore blank rows?
Hi i have the below script but i get an error if a row is blank ie a return in the csv file at the e

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