This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $data = [1,2,3,4,5,6,7,8,9,10]; | |
| $i=1; | |
| $count = count($data); | |
| foreach($ar as $a){ | |
| if($i == 1) echo '<div class="item">'; | |
| echo '<div>'.$i.'</div>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'nano filename.txt' command to open a file in cmd | |
| 'cat filename.txt' command to show the updated file after edit | |
| 'chown -R username.username foldername' to change user permission of a folder |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Add following input file right after textarea field... | |
| <input name="image" type="file" id="upload" class="hidden" onchange=""> | |
| 2. Add the following code in tinymce jquery code block... | |
| file_picker_callback: function(callback, value, meta) { | |
| if (meta.filetype == 'image') { | |
| $('#upload').trigger('click'); | |
| $('#upload').on('change', function() { | |
| var file = this.files[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function fFormatNumberToKMB($value){ | |
| if ($value > 999 && $value <= 999999) { | |
| $result = floor($value / 1000) . ' K'; | |
| } elseif ($value > 999999 && $value <= 999999999) { | |
| $result = floor($value / 1000000) . ' M'; | |
| } elseif ($value > 999999999){ | |
| $result = floor($value / 1000000000) . ' B'; | |
| }else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //make a class... | |
| class BanglaDate | |
| { | |
| private $timestamp; //timestamp as input | |
| private $morning; //when the date will change? | |
| private $engHour; //Current hour of English Date | |
| private $engDate; //Current date of English Date | |
| private $engMonth; //Current month of English Date | |
| private $engYear; //Current year of English Date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!--Pass the url and id in input field--> | |
| <input type="text" value="{{ config('app.url').config('appconfig.contentImagePath').$photo->img_path }}" id="url-{{ $photo->id }}" class="form-control" readonly> | |
| <!--Pass the id in onclick button--> | |
| <button type="button" onclick="copyUrl({{ $photo->id }})" class="btn btn-primary">Copy</button> | |
| <!--The javascript code--> | |
| <script> | |
| function copyUrl(id){ | |
| //alert('hello'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Clear all view, route, config and cache | |
| Upload the project in live server | |
| After that upload the dot prefixed files in the live server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| public function test(){ | |
| $days = new Carbon(); | |
| $bn_contents = BnContent::with('category','subcategory','content_meta') | |
| ->leftJoin('bn_content_metas', 'bn_contents.content_id', '=', 'bn_content_metas.content_id') | |
| ->where('bn_contents.created_at', '<', $days->subDays(7)->toDateTimeString()) | |
| ->where('bn_contents.status', 1)->where('bn_contents.deletable', 1) | |
| ->orderBy('bn_content_metas.total_hit','desc')->take(5)->get(); | |
| return ($bn_contents); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Date time difference | |
| $dt = date_diff(date_create('2017-01-01 02:20:10'), date_create('2017-02-01 23:23:23')); | |
| var_dump($dt); | |
| // Date difference | |
| $d = date_diff(date_create('2017-01-01'), date_create('2017-02-01')); | |
| var_dump($d); |