this is my code <?php $string = 'this this good good hahah'; $rows = explode("n",$string); $unwanted = 'this|good'; $cleanArray= preg_grep("/$unwanted/i",$…
Tag: php
How can I find the trashed or deleted posts in a WordPress database?
I’m working on a migration, been given a wordpress site, and I’m intended to migrate it to a new one, maded by me. I need to do a script to get all the useful posts (whitout the draft, the trashed or …
Laravel HasMany WhereNotIn Query
Problem: I’m trying to query a PeopleType to find all the courses where a person isn’t associated. I have 4 tables People PeopleTypes Courses People_Courses PeopleType_Courses I have the following …
Replace string in PHP – not working with longer string
I am beginner in php. I have this code: function allergen(string $value): string { $allergens = [‘pszenica’, ‘pszenicy’, ‘żyto’, ‘żyta’, ‘jęczmień’, ‘jęczmieniem’, ‘jęczmienia’, ‘owies’, …
Manticore – sphinxQL GROUP BY duplicated grouped id
When I using GROUP BY syntax in Manticore, there are results with duplicated grouped id. We’ve just migrated from sphinx 2.X to the latest Manticore, and in Sphinx there wasn’t this promlem with the …
How can I output an elements inside a foreach by generating a column layout?
I’ve a problem I need to solve. I’ve this HTML layout here in PHP:
<span class=…
How to take array object from the array object based on the highest value by a column in php
I have the following array, and each element of the array has a priority element. Based on the maximum priority value how can we generate the new array? Array ( [0] => stdClass Object …
Laravel one-to-many relationship with different column than primary key
I have following two tables: account: +————————–+———————+——+—–+———+——-+ | Field | Type | Null | Key | Default | …
PHP cURL: could not resolve host (over VPN)
I work remotely and can access internal servers via VPN. When my VPN connection is established, I can reach my webserver via curl: curl http://sub.mydomain.com I can also reach the webserver in a …
PHP Colour Not Being Acknowledged
I am doing some testing with FPDF and running into an issue. When setting a container to pull it’s colour from a pre-defined variable it is not honoring the value and I can’t see why not. Example …