Questions tagged as 'php'

1
answer

Format string in PHP

I saw some examples here in StackOverflow , but I just could not. I need to format this string: 'personalization_id="v1_i8b1bAFy7m6K+j3TseNGDw=="' If I use a $cookie = explode('=', $cookie); it looks like this: 0 => string '...
asked by 23.10.2017 / 18:55
1
answer

Call php without leaving the page with HTML

I would like to make a button with the tag < a > from the html to call an external php code. Example <a href="arquivo.php"> In which .php file would be just a few commands, I'd just like to run them without actually opening a...
asked by 19.10.2017 / 16:52
1
answer

Submission Ajax - Enter

How can I make a submission with ajax using the enter key? That is, I have the following code: var nome = $("#nome").val(); jQuery.ajax({ method: "get", url: "teste.php", data: { "nome": nome },...
asked by 17.09.2017 / 14:04
1
answer

How to call a function inside a PHP script from the command line

I want to know if I can call a function inside a script from the command line, using for example: $ php script.php minhaFunção() <argumento> In this case, the function is not inside a class (do I need to be?) Below my code: <?...
asked by 11.08.2017 / 04:09
1
answer

Restriction of characters at the end of regex

I need to have a regex capture urls that only end with letters or numbers. I have this regex here: (https?)(:\/\/www.site.com.br)(\S){1,} As it is, this regex allows urls to end with characters like @,!,?, etc. I tried doing this usin...
asked by 11.08.2017 / 17:01
1
answer

PHP Regex Issues

I'm trying to get some information from a webpage and I'm using regex for it. I'm using regex101.com to test the pattern and got to one that suits me perfectly. It happens that this pattern works perfectly on regex101.com, but when I do the s...
asked by 11.08.2017 / 16:27
3
answers

Excel rounding value 7,256E + 18

That old doubt with Excel cell formatting is causing me problems now. I use laravel framework and to export the data I use Laravel Excel . I am formatting the cell for text type and even then Excel continues rounding the values and changing...
asked by 28.09.2017 / 13:35
1
answer

Insert only filled data from the PHP array

I have a table, and I looped for it to receive input and also to do insert, however I'm having problems in INSERT and UPDATE . Where I have two codigo_tipo , descricao fields that are always inserted together int...
asked by 30.09.2017 / 15:30
1
answer

What is the difference between static :: Property, ClassName :: property, self :: property?

I know that parent::propriedade , you select the parent class property, but I am not able to differentiate these other three when I use within the scope of the class. Both work, but what's the difference?     
asked by 02.10.2017 / 20:37
1
answer

Find similar metrics by the Youtube API

I was viewing the Youtube APIs documentation, but I could not see clearly the following situation: How could I compare metrics (or data) from my two channels or their videos, having the 2 API keys in the database? For example, I'm in my...
asked by 29.09.2017 / 14:34