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
-2
votes
2 answers

PHP Unsetting values in another array with identical key

I have two arrays. I have a foreach loop which is iterating through one of these arrays ($items). For each value in this array, if a condition is not true, I would like to unset that same key, but from another, similar array ($list). (The two arrays…
ButtressCoral
  • 113
  • 2
  • 13
-2
votes
1 answer

How to unset or remove an array from a mult dimension array when you only know the key of the child but not the parent

I am working on an indexing proj. its all fine up until when i have to udate the index file. i want whe a website is deleted by the admin, all its index posting lists should be deleted. please help by pointing me to the write way of removing an…
katwekibs
  • 1,342
  • 14
  • 17
-3
votes
2 answers

Unable to create a personalized unset

I would create my own personalized unset function but it does not work. Here is an example of code that does not work.
Jérémy Dupont
  • 275
  • 1
  • 4
  • 11
-3
votes
1 answer

How to delete values from JSON object array in php?

I have a PHP code and JSON as shown below: PHP Code:
flash
  • 1,455
  • 11
  • 61
  • 132
-3
votes
2 answers

PHP why is $_SESSION variable refusing to unset on browser close?

I am relatively new to php but I am encountering an error that is about to drive me INSANE. I am working on creating a webpage that lets you browse files on the server. However, for some reason, the $_SESSION variable keeps itself set, EVEN AFTER…
Randomdude
  • 101
  • 2
  • 9
-3
votes
1 answer

PHP - unset function unsets my var before my code

I would like to clear my session vqriqble "flash' using the unset function but now I can't print my flash message because the unset function is called before my previous code. It is called in my header template : header.php wich is called in every…
user4112557
-3
votes
6 answers

PHP cannot unset cookie

I have problem in my code. I have tried to search on the right columns some answers that can help me, but i didn't found. This is my inset code:
Paz
  • 101
  • 2
  • 13
-4
votes
3 answers

-bash: Unset: command not found

When I log in to my remote server, using ssh, I got a message -bash: Unset: command not found. You can find a sample screenshot These are details of the server. ~$ lsb_release -a LSB Version: …
subrata
  • 111
  • 3
  • 8
-4
votes
1 answer

Unset array value if it contains certain word

I want to unset an array value if it contains a certain word in it. What I am doing is that, I am pulling all the emails from gmail inbox and only displaying the emails from the the message body so i can update it in the database. Message body…
Malkoc
  • 79
  • 8
-4
votes
1 answer

remove subarray with php

I have the following function and it's objective is to filter in the array tree those elements what are not conform to the search index and eliminate theme. I can get this function to bring the desired results. public function…
lgt
  • 1,024
  • 3
  • 18
  • 33
1 2 3
39
40