Questions tagged as 'php'

6
answers

Re-write and close array of a file

How do I open a configuration file, re-write the value of an array, and close and save the file? Example: config.php return Array { 'DB_TYPE' => 'mysql', 'DB_USER' => 'root' } config.php (After the function is executed): ret...
asked by 30.08.2015 / 22:53
5
answers

Does PHP only connect to MySQL?

I've never seen PHP connect using other databases, such as Oracle for example. In MySQL, to connect, is mysqli connect used, and if it was in another? PHP is integrable with which database?     
asked by 23.06.2017 / 18:35
4
answers

Deliver a 16-digit number in PHP

Number: 9999999999999999 It looks like this: 9999 9999 9999 9999 $num1 = "9999"; //parte 1 $num2 = "9999"; //parte 2 $num3 = "9999"; //parte 3 $num4 = "9999"; //parte 4 I would like to do this, without losing any number or adding anythi...
asked by 27.10.2017 / 15:28
4
answers

Number formatting (php)

I created a function cotacaoDolar(); which returns at the end: return str_replace(",",".",$texto_dolar); And the result appears here: echo $i['sellingStatus'][0]['currentPrice'][0]['__value__'] * cotacaoDolar(); How do I format...
asked by 01.04.2014 / 19:51
1
answer

Local MySQL synchronization with remote

I would like to know if it is possible to replicate a local MySQL database with the remote. I use PhpMyAdmin and I do not know if it will be possible because I do not have a fixed IP to find the other one.     
asked by 06.07.2016 / 12:54
1
answer

Connect webservice with SOAP in PHP

I am trying to connect to the webservice but it is not working. The wsdl address is link PHP code: <?php if (!class_exists('SoapClient')) { die ("You haven't installed the PHP-Soap module."); } $clientSoap = new SoapClient(...
asked by 10.02.2015 / 00:13
1
answer

Laravel 5.3 - Events or observers?

I have some scenarios where I can use observers to trigger a notification, however, for me it would be indifferent to use observer or else to create an event, a listener and then use this to trigger a notification. Is there a performance diff...
asked by 31.10.2016 / 18:51
3
answers

What to use require / include / require_once / include_once?

I'm developing an application in PHP and would like to know when and why to use% or require or include or require_once ? I also noticed what you can do in these ways and it works: require_once myfile.php; require_on...
asked by 09.05.2014 / 10:18
3
answers

How to crop an image to the center when uploading the same

In the project here I want to display the images in a square-sized dynamic div where its maximum size is 240 x 240. Assuming a user uploads an image with a rectangular dimension (eg 500 x 280), that same div becomes "disfigured" since its hei...
asked by 31.08.2014 / 03:42
2
answers

Minimized pages and processing for each requisition

If I want to minify an HTML page from PHP, will I be gaining or losing more? More clearly: I want to keep formatting and practice for when editing the page, preserving the edentation. But I also worry about loading the page, since in developm...
asked by 10.06.2015 / 02:12