Top "Variables" questions

THIS IS AMBIGUOUS; USE SPECIFIC-LANGUAGE TAGS WHENEVER APPLICABLE.

How to add elements to an empty array in PHP?

If I define an array in PHP such as (I don't define its size): $cart = array(); Do I simply add …

php arrays variables
How do you check if a variable is an array in JavaScript?

I would like to check whether a variable is either an array or a single value in JavaScript. I have …

javascript arrays variables
How to check if type of a variable is string?

Is there a way to check if the type of a variable in python is a string, like: isinstance(x,…

python string variables types
How can I check if an element exists in the visible DOM?

How do you test an element for existence without the use of the getElementById method? I have set up a …

javascript dom variables element exists
PHP Pass variable to next page

It seems pretty simple but I can't find a good way to do it. Say in the first page I …

php variables session
Append integer to beginning of list in Python

I have an integer and a list. I would like to make a new list of them beginning with the …

python list variables append
How do I put a variable inside a string?

I would like to put an int into a string. This is what I am doing at the moment: num = 40 …

python string variables
How to declare variable and use it in the same Oracle SQL script?

I want to write reusable code and need to declare some variables at the beginning and reuse them in the …

sql oracle variables declaration
Non-static variable cannot be referenced from a static context

I've written this test code: class MyProgram { int count = 0; public static void main(String[] args) { System.out.println(count); } } But …

java variables compiler-errors non-static
How to interpolate variables in strings in JavaScript, without concatenation?

I know in PHP we can do something like this: $hello = "foo"; $my_string = "I pity the $hello"; Output: "I …

javascript string variables string-interpolation