Skip to content

How to get multiple tables and show them in JSON

I have these tables in MySql The output should be like this This code gives me data of one table only I’m new with PHP so I hope someone shows me how can I do it like above. Thank You……………………………………………&#…

Install mailparse on linux centos7

Hi I’m trying to install mailparse for my php7.4.21 on my linux centos7 server but the documentation is not great and I’m no sysadin. https://www.php.net/manual/en/mailparse.installation.php states “In order to use these functions you must compile PHP with mailparse support by using the &#82…

Nested Loop in Edit Form Blade Laravel

I have an edit form that used rowspan table and nested loop. I also have a create data form that works fine like this. I used Laravel 8 for this project. Create form But when I’m adding the value from database to create the edit form: Edit form -1 Edit Form -2 I get the sasaran, indikator, and data (que…

How to print string to console Yii2

I am really new to Yii2 and I am trying to print a simple string to the console. However, no matter what I do, I can’t really make it work. I am not sure if I have my Setup wrong or if I simply don’t use the functions as intended. My TeamController.php was generated by Gii and the function I

PHP negative time calculation

If I add 1 hour and 35 minutes in PHP and subtract 4 hours, I get a remaining time of -3 hours and 30 minutes. But correct would be -2 hours and 30 minutes. Where’s the mistake? Answer $minutes – floor($minutes/60) is positive. So what you’re getting is -3 hours plus 30 minutes, which is -2:30. Yo…

Bolding a keyword if found in a string

Greetings, Actually I want to bold a keyword if it is found in a string. I am using php preg_match() method for this purpose. My keywords are stored in an array and by iterating through each keyword I match it with my string and then bold it. I am facing a problem here. Both of the above strings are giving

Laravel model user custom binding “/users/me/xxx”

I have routes with user binding like So I can use /users/1/posts, /users/5/posts etc, and in controller it’s automatically available thanks to model binding But for current logged user I want to make possible to also use /me/ instead ID, like /users/me/posts Is there a way to make it without defining se…