Skip to content

Tag: arrays

PHP Multidimensional array number formatting returns A

I am having issue with number formatting of array elements. It always returns an “A” letter, no matter element value. I am calling for that value with adress $tab[‘VII’][‘B’][‘podatek’][‘PTUG’] An this is part of an Array: I am using tcpdf with this …

Recursive function and add to an array

I need recursive function to add element into an array. This is my code: Basically, if I echo $new_x and $new_y, I get what I’m expecting. Problem is my $result array, it gives me only first item (2 -2) but second is missing (1 -1). I guess problem is with adding item into array but cannot find the prob…

PHP: Adapt number ID to words

What do I need to do to convert the number only if all the number matches? At the moment, it’s converting to each number. (I’ve tried to do a lot and I didn’t succeed) I would like to know if have any way of adapting to only show the word if the number “is complete”, otherwise sh…

Shuffle() returns same results

I’m having a problem with using a basic shuffle() function in Laravel. It returns the same result, which seems to be changing once every 10 or 20 minutes. Here’s the basic code I’m testing: And here’s the log: Answer You probably initialize your random seed with a constant value somewh…