Skip to content
Advertisement

Tag: php

Yii2: Rest POST Request Parameters not arriving

Good morning, I dont get any further in this Topic so i am writing a Question here. First of all i created a DB Table with Data from the Tutorial: https://www.yiiframework.com/doc/guide/2.0/en/start-databases Then i created a Rest Controller from that Tutorial with the Data above: https://www.yiiframework.com/doc/guide/2.0/en/rest-quick-start The first example GET Request from the Tutorial works fine and gives me all of

Match Country in String, split based on result

I have a CSV file with one of the fields holding state/country info, formatted like: “Florida United States” or “Alberta Canada” or “Wellington New Zealand” – not comma or tab delimited between them, simply space delimited. I have an array of all the potential countries as well. What I am looking for, is a solution that, in a loop, I

why is my recycler view only showing 1 card

the app is used to sign up for events. Now I am unable to display more then one card in the recycler view even though there is data in the database.it only would display only the first row of data. I know this as I have deleted the first row and the app shows the new first row. The php

PHP Regex Match ! or * anywhere in string

I’m a beginner in using Regex and have been struggling to create a pattern that can search for a single match of either ! or * anywhere in my string. The full requirements I am looking for are: Start with a letter Contain at least 1 number Between 8-16 characters Contain at least one ! or * What I have

Subtracting days from a future date

It is working as expected. $newdate prints as 1 December 2022 However, if the $tour_date is not the current year, it does not work properly. It is still printing as 1 December 2022. The $newdate prints as 1 December 2022. But it should be 1 December 2023 which is -10 days from 11 December 2023. Any idea, that will work

How to create if statement in foreach in php

How to create if function in foreach in php I want something like this if(currency==id) script should exclude it Here is the php code Answer Assumptions: You want to exclude all items that have the same id and currency. Each item in the result should have the keys ‘id’ and ‘currency’. You may use the functions array_map and array_filter to

Advertisement