Skip to content
Advertisement

Tag: php

Adding subfolders to zip file in php (laravel)

I have a function which is working fine to create zip file from folder files. But recently I’ve had need to add sub-folders into my main folder and now I see my function does not add those sub-folders and files in them into generated zip file. here is what I have currently: By using code above, let say I have

errors messages with html and php

i have this code bellow: it doesn’t show any error when the email is not correct or the password is less than 6, and inserts data normally, I need to show for example two error messages if both password and email are not correct, how can I do it? Answer Amend your code so that it will NOT execute the

How foreach loop work to sum value of same key in associative array

I have associative array.Operation of the below code is that it will sum all the array index’s value which key is similar, but i did not understand how it operated. i have problem in two portion of above code one is: if ( !isset($sums[$key]) ) { $sums[$key] = 0; } another is: $sums[$key] = ( $sums[$key] + $val ); In

How to sum php array that have same key but different sensitivity

I want to sum the value of keys that are the same but in diffrent case. Let’s say we have this array Answer Loop through the keys and values. Convert each key to uppercase. In a 2nd array, set the key/value to the sum of the current value in that array (or 0 if it doesn’t exist) plus the value

Advertisement