Skip to content

Array Data Unable to be Iterated Through (PHP)

NOTE: This is just test code because I am learning PHP, so there’s no real point to it. Essentially, all I’m asking is how to turn the array of objects back into a form that I can use. ISSUE: I’ve created a new object array with 8 different produce items. I would like to write them to a .txt…

Query that only selects unique data

I just can’t make a request that will count only unique records. There is a table: bbs with columns: to_id – to whom from_id – from whom You need, for example, this data: That is, for example, we are 1. And it should count not 5, as it currently thinks, but 3. You need to select 2 columns, o…

How to allow CORS in Yii2?

I have a JavaScript frontend that ask for a plain text to my PHP backend. It almost works excepts because I have a CORS problem. How can allow CORS in my PHP code? My frontend (JavaScript and jQuery): My backend (PHP and Yii2): Answer Yii2 supports CORS handling, as written on the official documentation. Alte…

Cannot step xdebug with NetBeans since php 8

Since upgrading from php 7 to php 8, I can no longer Step Into/Step Over/Continue with NetBeans IDE 11.0 and xdebug 3.0.4. xdebug (via NetBeans) is configured to “Stop at First Line” – and this works. That is, the (local host) web page is suspended, and the NetBeans Step Into/Step Over/Conti…