Questions tagged [unset]

Removing the value associated with a variable or property from the current environment.

Common usages:

  • Destroying a variable or member of an array in PHP.
  • Removing the value bound to a property in Apache Ant.
  • Removing a variable from the environment of a shell script.
595 questions
0
votes
5 answers

unset javascript array for

I've been trying at this for hours now and I thought it would be really simple; Using javascript I basically want to iterate through an array, get the current value of the index and then unset this value from the array. I've found splice() is…
ddoonn
  • 11
  • 3
  • 8
0
votes
1 answer

php session pass with setcookie and unset

i have a strange problem, when i use setcookie in PHP with session, while my browser is open, everything work fine, but when I close it, then I can't pass $_SESSION from page to another page! in login page I have: $_SESSION['name'] =…
Vahid
  • 382
  • 1
  • 6
  • 19
0
votes
1 answer

Unset session after sometime [How to Delete Data After Some Time]

i have a Simple Chat script of php it has no database it work fine. but it create and store all chats in a file msg.html i want to delete these chats after some time. How to delete these chats after some time about 30min. The Php Code is here below…
IamRobin
  • 1
  • 1
0
votes
3 answers

How to make JSF handle unset values?

Before I was using JSF, the following code was working in JSP files: Error: ${request.getAttribute("error")} Now, when I am using JSF, I am getting this error: /login.xhtml @24,51 test="${not…
Adrian Adamczyk
  • 3,000
  • 5
  • 25
  • 41
0
votes
1 answer

mongodb $pull not working php

I have this object in my db. Array( [_id] => MongoId Object ( [$id] => 4fcdb3b8749d786c03000002 ) [email] => foo@bar.com [folder] => Array ( [root] => Array ( [feeds] => Array …
Arash
  • 3
  • 2
0
votes
0 answers

How to show unset widgets in Symfony 1.4

How can I show unset widgets in Symfony 1.4 in the Form.class.php without using javascript? I unset the widget at the begining of the configure function. I want to show it in the callback validation function. Thanks.
Academia
  • 3,984
  • 6
  • 32
  • 49
0
votes
1 answer

Unset specific value in an array on mysql table

I have a table naming related_products, Where products_id is the main product. and related_products_ids consist of product ids related to the main product. -------------------------------------------- | products_id | related_products_ids | |…
Ken
  • 833
  • 2
  • 13
  • 27
-1
votes
1 answer

PHP - unset a value from Iterator

I have a filter iterator. How can a unset a give value in it. I have tried unset($list[$key]), but that gives me an error : Cannot use object of type Filter as array
ConfusedProgrammer
  • 479
  • 1
  • 4
  • 14
-1
votes
2 answers

PHP-Error in constant string

I suddenly get an error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in the following line: unset('SCAN/DATA.FIL'); I don't see the Error!
El Hippo
  • 367
  • 3
  • 13
-1
votes
2 answers

Remove/delete json value (multiple array)

I want to remove 'Software 3' in the array. I'm quite new with json data and I do not know what is the correct way to do it. I have tried the unset method but its not working. Can anyone show me the example. I already search the solution but most of…
Sue A.
  • 29
  • 6
-1
votes
1 answer

How to make PHP permanently running script "forget" everything and perform almost as a restart

I have a PHP script running permanently on a server. I have very limited access to restart it. Is there any way how to reset everything in the script from inside? I do not mean to physically stop and start the script. I'm looking for a way how to…
Láďa
  • 5
  • 4
-1
votes
3 answers

How can I destroy specifics $_SESSION variables leaving page?

I would like to unset some specifics $_SESSION variables after leaving a page, but the problem is that I have used pagination (using $_GET) for all sections of my site (contacts.php?page=1, ?page=2, etc; actions.php?page=1,?page=2 etc .;…
user15121576
-1
votes
2 answers

Unset variable from php array

I have an array which when printed out, looks something like below, although there are dozens of warning and success messages available: Array ( [warning] => Array ( [0] => We might have a problem. [1] => You…
-1
votes
1 answer

PHP for removing unwanted elements from multi-dimensional array with reference to a list of wanted elements

Edit: Download sample data here -> $csv The array of products at the top level is $csv. In the excerpt below, the numbers [584],[585] represent the next array level down $product => $data_col as you can see below: [584] => Array ( …
user136649
  • 59
  • 1
  • 7
-1
votes
1 answer

Unset an object from an array and then decode returns incorrect format php

I have an array of "components" stored in a database in json format, I want to delete (unset) an item and then save it back to the database. The problem I have is when I unset the item it adds extra numbers for the location of the array when I use…