2
votes
4answers
26 views
How to best structure hard coded array data in PHP?
I'm developing a PHP library and I'd like to add some hard coded data using arrays. How do I determine the optimal way to structure the data in terms of the array keys and values? For example, if I ...
0
votes
2answers
19 views
Merge multiple array php
I have below arrays.
(
[0] => 3
)
Array
(
[0] => 3
)
Array
(
[0] => 0
)
Array
(
[0] => 0
)
Array
(
[0] => 0
)
I want result as like below.
Array
(
[0] ...
0
votes
1answer
16 views
Need an associative array but with the same keys for NuSoap
I need to make a repeating array for this part of xml as an array, but as you can see there is a repeating item here.
<orderItems>
<OrderItemRequest>
...
0
votes
2answers
31 views
How to get array of strings from output php
I do a print_r($my_var)
and get a result like:
Array ( [0] => Array ( [email] => [email protected] ) [1] => Array ( [email] => [email protected] ) )
How to get a new array like
$mails= ...
1
vote
1answer
22 views
Tri-mensional array looping
I'm really stuck at a certain point in my project. I'm trying to convert a two-dimensional array into a three-dimensional array. Currently I´m at this point:
array (size=4)
0 =>
array ...
0
votes
1answer
28 views
PHP Echo one result from list of many that matches a specific number
The script is supposed to output a list of profiles who have a certain item in their backpack, for example item "125" At the moment this is the output:
Defindex: 125 - 76561197992146126
Defindex: 56 ...
-2
votes
1answer
22 views
PHP - replace character referring to another character sequence in the array
i have
$a='1024,1025,0000|1020,0000|';
$b='1024,1025,0000,1020,0000,';
i want replace commas (,) in $b with (|) so that $ b is equal to $ a
like this
Output :
...
1
vote
0answers
36 views
Multidimensional Array into MySQL
I'm trying to create a script to migrate over data from an old database structure to a new database structure, but I'm not sure if what I have now can work.
To start I created an array to store all ...
-2
votes
1answer
37 views
Why are my queries failing?
Here is my code where I am trying to execute my queries:
foreach ($ageGroups as $ageGroup) {
if ($mysqli->query("INSERT INTO national_age_gender_demographics (age_group, male_pop, female_pop, ...
1
vote
3answers
51 views
array_replace() / array_merge() | ( $_SESSION = array() ) argument is not an array?
I have this code for my school project and thought the code does its job on what i wanted it to do, i still keep on getting the error about $_SESSION[] is not an array argument when using the ...
0
votes
2answers
31 views
Array value is truncated to one digit [closed]
I'm using PHP to create dynamic checkboxes. According to my the Chrome elements inspector the values echo with no problem, but at some point after $_POST all my values are truncated to one digit.
...
-1
votes
1answer
60 views
How to loop through an array and add to it in JSON
I have an array containing several variables from my sql database.
{"gold":"0","silver":"0","bronze":"0","gdp":"12959563902","population":"3205000","country_name":"Albania"}, ...
0
votes
0answers
29 views
create rows from a multidimensional array where array contents arent consistent
I have a array named $postinfo as displayed below:
Array ( [customer] => Rapid Dawn 1183 (Pty) Ltd t/a Lumber Logistics [period] => 2013-05-13 to 2013-05-19 [line_1_09] => Array ( ...
-1
votes
4answers
20 views
Register form Error Correction in PHP - Best solution?
I'm looking for as simple approach to correcting errors such as non-matching passwords and people inserting blank data into a form in HTML.
I want to use PHP to throw me back an error when this ...
1
vote
0answers
21 views
How To Sort Wordpress Repeated Field
Can Somebody Please Help me Out in sorting of wordpress repeated fields.
I have repeated fields that contains value like this -
1st - 100GB,1 Month,Unlimited,$300
2nd - 200GB,1 Month,Unlimited,$500
...