Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
4 answers
109 views

How can I map an unknown value alongside other known values in bash using an associative array, so that: #!/bin/bash array=("foo" "foo" "bar" "something else" &...
2 votes
1 answer
82 views

Every example I have found tends to go aa["key"]="value" and even with constants, e.g.: declare -rA aa=( ["lit1"]="value1" ["lit2"]="value2" ...
-1 votes
2 answers
215 views

How can I reference an associative array and reassign its content from serialized string? (The eval requirement is now spelled out explicitly in the title, but this is natural when it comes to ...
0 votes
2 answers
86 views

I just started learning Python. I try to create a data structure from the file wg.conf I'm stuck on creating an array Peers. I need to create multiple Peer entries inside that array. Config file ...
1 vote
1 answer
86 views

I am trying to display data from multiple MySQL tables in individual text fields in an HTML form using PHP. Here are three sample tables from a database, followed by code that I am using to select ...
1 vote
1 answer
183 views

Here's the code: <?php declare(strict_types=1); /** * @param array{key?: string} $options */ function hello($options) { var_dump($options); } hello([ 'WRONG_KEY' => '...', ]); I ...
3 votes
2 answers
199 views

I'm working on a project written in C that's going to be deployed on vintage systems with very limited resources. The target system has at minimum a 16 MHz Motorola 68030 processor with a 256 byte L1 ...
-7 votes
2 answers
91 views

I get an array of associative arrays of selected company's hierarchy combinations (Some hierarchy levels may be null). For example, if the hierarchy goes division > department > team: [ 0 =>...
-4 votes
1 answer
138 views

I am trying to build an associative multidimensional array like this: array( [0] => Array( Parent => Mr Smith, Children => array( Firstmane => Bob, ...
1 vote
1 answer
209 views

I want to loop through a JSON object and add the keys and values to a Bash associative array. Here's my JSON object that is in a file named deploy.json. "deploymentEnvs": { "dev":...
0 votes
2 answers
79 views

The following script works as expected for me on FreeBSD using bash-5: function a { declare -gA Seen if [[ -v Seen[1ドル] ]] then echo "Saw 1ドル already" return ...
-1 votes
1 answer
73 views

How to dynamically convert a string into (and revert from) UTF8 special font characters "on-the-fly" using PHP functions? For example, echo cvtIntoSpclUTF8FntChars('script', 'Hello, World!');...
1 vote
3 answers
117 views

The output from the following code does not behave how I think it should. It appears that making changes to the string array returned by testAA.require() does not reflect in the associative array. I ...
-1 votes
1 answer
52 views

Good morning, I have here: declare A- accocArray1=(["a01"]=1 ["a02"]=2 ["a03"]=3) declare A- accocArray2=(["b01"]=1 ["b02"]=2 ["b03"]=3) ...
1 vote
4 answers
114 views

Is there a shorthand for the following code: $result = array_combine( array_map(fn($elem) => "key_$elem", $array), array_map(fn($elem) => "value_$elem", $array) ); ...

15 30 50 per page
1
2 3 4 5
...
222

AltStyle によって変換されたページ (->オリジナル) /