I have a simple $_GET[] query var set for showing testing data when pulling down queries from the DB.
PHP DateTime round up to nearest 10 minutes
I’m retrieving a datetime from a mysql field but I need to round it up to the nearest 10 minutes. For example, If the datetime is 2013-11-06 14:00:01, I’d like to return the time as 6/11/2013 14:10. What’s the easiest way to do this? Any advice appreciated. Thanks. Answer 1) Set number of se…
Json_encode or remove last comma?
I figured out how to get my desired result (almost). My code adds a comma at the end before the last ] so it wont quite work. I know I can use Json_encode to build my array from my external json but I’m stumped. I either need to remove the last comma or use json_encode (which i’m lost on) any
Displaying the clicked value (link) on a page in a modal window together with the index value
I have a page with some values in a table which are read from a .csv file and displayed. The values changes with time (dynamic), So I am using for loop in PHP with the size of the file as limit of …
Getting radio selection in PHP returns on not the value
I am trying to get the value of the selected radio button using php. But when I try to echo the value of the radio it returns ‘on’, no matter which radio button is selected when I submit the form. HTML: Then on the process page: Like I said, this just outputs “on” to the page. Help app…
Executing Python Script with PHP Variables
I am writing a simple application that uses information from a form, passes it through $_POST to a PHP script that executes a python script and outputs the results. The problem I am having is that my python script is not actually running with the arguments being passed in. process3.php file: Output: At the to…
dompdf HTML to PDF – can’t set margin of page
version: 0.6.0 beta 3 I tryed in every manner to make dompdf set the margin of the page. I have a long page with a lot of text, divided in chapters… my css is something like: when the php is but what I get is a page with NO margins!!! only the padding of the #wrapper are applied… and they
Is it possible to store an array as flash data in Laravel?
I have been looking around for a way of doing this. I know it is possible to store an array in the session with the following: Session::push(‘user.teams’, ‘developers’); Is it possible to do the same but with flash data? Something like Session::flashpush(‘user.teams’, array…
array_push is replacing the variables instead of adding them to the end
Does anyone see an issue? Array push is just replacing variables instead of adding them. The variables of $fname, $lname, and $gender are defined by the user in a form. I want the variables to simply be added to the end of the array instead of being replaced. Any responses are appreciated. Answer if $info[…
sprintf argument swapping and HEREDOC
I’m trying to use sprintf on a heredoc this way. It wont work. Any idea how to solve this? $i = <<<EOD This is your invoice for %1$s %1$s %1$s %1$s EOD; $year = '2013'; $i = sprintf($i,$…