Skip to content

How to convert XML to JSON in PHP

I want to convert som xml data into some pretty json data then output it into an api. The output is not the problem but it’s the formatting of the xml data. I’ve looked around, but haven’t gotten around making it as pretty as some of the online converters out there. this is the xml data stru…

PHP8: vertical line with a type?

I found this line of code to be problematic on a server running PHP7.4: I get a ParseError, with PHP expecting a variable. Couldn’t find the symbol’s usage as it is here in Reference — What does this symbol mean in PHP? What do the vertical bars mean here? Also is there a way to rewrite this so it…

Changing the content of a message sent by my bot in Discord

I use a slash command to create a channel, and in the channel, a message whose content is like this : Then, the bot pins this message. All that works fine. Now, I wanna use another command to change that content. Here is how I try to change the message’s content : The “Message changed” is co…

Select subquery error Subquery returns more than 1 row

Table 1 Table 2 #1242 – Subquery returns more than 1 row I am trying to get concatenated values from the other table with matching ids from this table that I have given in the foreign key like this: Edit: I changed the code: New Error:#1054 – Unknown column ‘products_brands.product_id’…