![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 224 Pomógł: 0 Dołączył: 31.10.2012 Ostrzeżenie: (10%) ![]() ![]() |
Witam. Napisałem prosty skrypt, który wkłada do tablicy przedmioty, które wybrał użytkownik. Wszystko działa dobrze jednak mam problem z wartością ilość, która zawiera informacje ile sztuk danego przedmiotu wybrał użytkownik. Napisałem instrukcję if, która sprawdza czy istnieje juz w tablicy element i jeśli tak to zwiększa jego ilość o wartość przychodzącą z POST. Jednak nie działa to tak jak należy. Czy ktoś może podpowiedzieć mi co robię nie tak? Z góry dziękuje i pozdrawiam.
|
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Moderatorzy Postów: 36 559 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
No i kolejna sprawa
http://php.net/manual/en/function.array-search.php Cytat Return Values ¶
Returns the key for needle if it is found in the array, FALSE otherwise. If needle is found in haystack more than once, the first matching key is returned. To return the keys for all matching values, use array_keys() with the optional search_value parameter instead. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. |
|
|
![]() ![]() |
![]() |
Aktualny czas: 15.10.2025 - 08:01 |