Skip to content

add additional header to symfony mailer message

I don’t use the Symfony Framework. When I add my header like then a $mailer->send($mail); doesn’t work anymore:-( How do I send mail? Answer getHeaders functions return an header, so in your $mail, you dont have an email but a Header

xPath problem while changing a XML file with PHP

I’m trying to modify a XML file. I tried same code with an more basic XML file and it worked perfectly. But when I use the same code for some other XML file with changing the path, I am getting this: This is the XML file: (I sign the line I want to change for example) So I use the

How can I remove duplicate record in php (Array unique)

I have an array of records and I want to remove the duplicate record. I know we can use array_unique() to remove duplicate value but in my case I have an array of records like(Date, Url, xyz). I want to skip the date column while checking the duplicate record. You can check my code bellow. You can check that …

Retrieve data from the name of a directory in my database

I use php and laravel. I have a column named MsgBody. In this column, there is an array as follows. I want to get the value of “conversationDesc” from this array. What should I do in the Controller and blade part for this? Answer It seems that your data are JSON. You can decode this using json_dec…

How to search in XML? (PHP)

I am working on a word application. I’m trying to get values from XML. My goal is getting the first and last letter of a word. Could you help me, please? PHP code: Answer The letter is in an attribute named ‘category’. Or in SimpleXML

CakePHP 3.9 Routing prefixes

I have the following path inside my / Scope: And on my src/Controller/UsersController.php i have api_index() But when i go to the url api/Users/index it says Controller not found, because is asking me to add another UsersController inside a subfolder named Api on Controller folder. Untill Cakephp 2.x using th…