Questions tagged as 'php'

2
answers

Get URL with regular expression links

I'm trying to extract only the URL if an expression is validated with the [monitory] tag. The expression I use is this: (?=<a.*\[monitory\].*href=["|'][http:|https:]?[\/\/]).*?["|']> And for example on a link like this: &l...
asked by 16.11.2018 / 00:32
2
answers

Using REGEX in PHP to capture any number that is not within single quotes

I have been studying regex for some time and now I have a problem: Capturing all numbers, including decimals, that are not within single quotation marks . I'm creating a sort of viewer for PHP code to learn how to use regex better. I have...
asked by 19.12.2018 / 17:09
1
answer

Is it possible to de-structure an array in PHP equal to or similar to the list in Python?

In Python we can de-structure a list like this: lista = [ "Maça", "Pera" ] maca, pera = lista print(maca, pera) The output will be: Maça Pera I know that in PHP it is possible to get the result using the function list $lista...
asked by 07.11.2018 / 00:26
2
answers

Differences when instantiating a class

Using PHP when instantiating an object I do it as follows: $obj = NEW my_class_exemplo; however the auto complete of netbeans always gives me the option to put with parenthesis like this: $obj = NEW my_class_exemplo(); Question...
asked by 22.01.2014 / 23:33
3
answers

How to correctly format a monetary value?

I have a value that comes from the form this way: R$ 1.500,95 I need it to look like this: R$ 1500,95 How to make it become like the 2nd way? I need it to look exactly the way it was quoted.     
asked by 08.06.2017 / 22:41
1
answer

PDO shows no errors

My connection code does not show errors, what is the problem, I searched in several places and did not find anything about it: class Connect { protected static $db; public function __construct() {} public static function Databas...
asked by 31.05.2017 / 16:54
2
answers

Doubts regarding the use of json_encode and json_decode

When and how should we use json_encode and json_decode ? What are they for?     
asked by 22.06.2017 / 17:28
2
answers

How to change the PHP DateTime JSON serialization format?

In PHP, when I use a json_encode in an object of type DateTime , it has the following result: $date = new DateTime(); echo json_encode(compact('date'), JSON_PRETTY_PRINT); Output: { "date": { "date": "2018-08-09...
asked by 09.08.2018 / 19:01
1
answer

What mysql.sys?

Good Night Personal, I just installed wampserver, later I was able to access phpmyadmin, but I found something strange in user accounts. As users only had mysql.sys and root, being the root that I created. Can anyone tell me about this?...
asked by 28.01.2017 / 23:04
2
answers

When to start the site already request the login

I'm creating a website and I have a question. How do I do when the user enters the URL address or click a button that goes to admin.html, and automatically appears the login page? or as soon as you start admin.html already appear first the login...
asked by 26.12.2016 / 01:00