Questions tagged as 'php'

2
answers

Show Processor Usage

I'm trying to show the use of the server's processor with PHP. Server is Windows with IIS. I've already tried using: exec("wmic /node:localhost path Win32_Processor where DeviceID='CPU0' get LoadPercentage", $out); exec("wmic cpu get loadperc...
asked by 06.09.2016 / 15:32
1
answer

Is there a difference when joining two arrays with array_merge or with "+"? [duplicate]

I used to merge two arrays into PHP using the array_merge function: $arr3 = array_merge($arr1, $arr2); However, more recently I have seen arrays unions with + (sum sign): $arr3 = $arr1 + $arr2; Is there any differen...
asked by 27.06.2016 / 11:22
1
answer

Mapping and getting mileage between two points

I'm developing a web application, and I'm getting two addresses for a text field, and I'm using it to calculate the distance to the Matrix API from Google Maps, so beauty, but I also wanted to generate a map showing that path, and that this path...
asked by 09.07.2014 / 01:41
2
answers

What is the best way to upload files with Ajax?

I could get a code on the internet paste here and try an answer but I'd rather have it help me with the logic and programming of a script to upload images in Ajax. I do not know how to start, I'm a beginner but I already know some things about j...
asked by 05.08.2014 / 15:23
2
answers

Is it a bad practice to override variables declared as a function parameter?

I had the habit of "reassigning" a value of a particular variable that was declared as nome of the function parameter. Example: function format($string) { $string = ltrim(rtrim($string, ']'), '['); // A questionada atribuição...
asked by 11.08.2015 / 17:19
1
answer

How to distinguish FALSE from empty string?

Several PHP functions (eg SplFileObject :: fgets ) return FALSE in case of error (eg end of file), but may also return an empty string (in this example, if the file has an empty line); it is impossible to distinguish the two cases with t...
asked by 16.06.2015 / 22:50
1
answer

How to send 200 emails (not newsletter) without running the risk of going to spam list?

Every month we send 200/300 handmade emails with variable text to customers of the month (not newsletter). Via PHP I can make the text dynamic, and send it automatically, but the problem is sending 200 emails without the domain going to a spam l...
asked by 14.01.2016 / 15:00
2
answers

How to loop with while using array

Hello, I would like to know if it is possible to loop using while so I need the values of the $newsmedias1 array to be placed in while in order to make the appearance of the items with the given IDS in the Array as lo...
asked by 22.10.2015 / 15:41
3
answers

Replacement of variables in the body of the message

I am creating a message profile system, when the system performs a certain action it picks up a certain profile and triggers the message as email , however I would like it in the message body when writing {{variavel}} would like it to t...
asked by 16.05.2015 / 21:47
1
answer

How to convert a JavaScript array to array in PHP?

The system gives me a JavaScript matrix to work on the page. I can get this array with PHP, but I do not know how to convert from JavaScript to PHP and work using PHP. This is an example of the JavaScript array: <script type="text/...
asked by 02.03.2015 / 04:04