Skip to content

Make word bold with setValue in PHPWord

How to make the replaced word bold and underline when using TemplateProcessor in PHPWord? Found solutions are very old (2016). I tried to create my function, to edit xml document, but done file is crashing. My code: Tried this function: Answer

Filled many Textbox with Select box using laravel

I want to display data in a text box based on the selected options. for example if If I select the title of the book, it will display the author of the book, the price of the book, the year the book was printed. I want to display the book based on the selected option chosen my Controller my Model

PHP file reading

I have a txt file with name source.txt and has the following content. I read and echo all the content. But I want specific data and assign to the variable. if I need name. Then read the file and select john and assign to the variable Answer Here an mini code example exemple script

Add class only on first carousel-cell (flickity)

i would have the class “opacity” inserted only at the first “carousel-cell”. For the rest in the loop, they should not be there. Answer You could use the $loop->first variable to add a class only on the first iteration of the loop. Like this: <div class=”carousel-cell {{ $l…

Yii2: Controller action parameters with a dash?

If I have a URL like https://example.com/controller/action?customer-id=7414 how do I get customer-id in my action parameters? Since a dash is not allowed in variables names I cannot do the following! Documentation is usually excellent but on this exact point it’s just silent. How do I solve this? Answer…