Posts by Bruno Augusto • 8,661 points
187 posts
-
3
votes4
answers180
viewsA: Remove array positions that have the common name
If I understand correctly the goal is to transfer from the input array all elements that have the same prefix characterized by an expression followed by a underscore. Therefore, I propose the scheme…
-
3
votes2
answers14275
viewsA: How to receive an array and print your content using PHP?
Disregarding the syntax error pointed out by Sergio and considering the requirement for the array to be printed as a string, you have, without iterating, at least three options but all followed by…
-
5
votes1
answer2063
viewsA: Pattern doesn’t allow accented character?
There are two errors and a problem in the Regular Expression attribute Pattern that you defined. I couldn’t make a letter bar equivalent to the POSIX class [[:alnum:]_] work, so what you have for…
htmlanswered Bruno Augusto 8,661 -
1
votes2
answers1970
viewsA: What is the relativity of the rem unit?
TL;DR REM units are relative to the size defined in the main element and not relative to the selector parent element where font-sizehas been defined. What are REM and EM in CSS? IN The "in is a…
css3answered Bruno Augusto 8,661 -
3
votes3
answers1361
viewsA: Validate different date formats
It seems you have a more serious problem than just date formatting: because they are standardized or standardized in a single type/input format. As this does not fit the scope of the topic, if I…
-
1
votes1
answer855
viewsA: Error 229 in SQL Server
I have no experience with SQL Server, but maybe information brought of SOEN can help you. According to the topic, in that order: You should not delete any ## certificates from master You must not…
sql-serveranswered Bruno Augusto 8,661 -
1
votes1
answer1261
viewsA: Create vCard file (.vcf)
You have two different questions: List data from an Sqlite database Generate the vCard The first problem is simple, just use the PDO or the Sqlite. Just connect, run the query and read the resource.…
phpanswered Bruno Augusto 8,661 -
2
votes1
answer192
viewsA: Returning Image with Google Feed API
Are you seeing the Undefined? You are adding to the resulting string a value that does not exist during the XML iteration. Within this iteration you need to iterate the image collection and mount…
-
0
votes3
answers851
viewsA: Regular expression to find word exception
Well, you didn’t choose a specific language so I’ll be doing it with PHP because I have greater familiarity but the ER itself I believe is functional in other languages as long as they support…
regexanswered Bruno Augusto 8,661 -
4
votes3
answers226
viewsA: Link structure problems in MVC
The function below is an adaptation to mine Request::getBaseUrl() and works almost the same as the @Wellington proposal but uses server variables for the first immutable half of the final string:…
-
2
votes3
answers1146
viewsA: How to stop running $.map?
Unable to interrupt the flow of jQuery.map() in itself because its purpose is to be applied to all elements of the given array. But it is possible to do its callback ignore certain iteration values,…
jqueryanswered Bruno Augusto 8,661 -
1
votes1
answer733
viewsA: Comparing dates of an array in PHP
With the recent issues you have two problems: Your query is not returning what is expected You’re comparing strings hoping to get notions of time The first problem only you can solve because it…
-
4
votes1
answer951
viewsA: Is there any way to get the "value" of a "select" from PHP?
Mixing PHP with HTML although wrong is acceptable, now mixing PHP with Javascript, 99% of the time is the worst union that can occur. Separate everything, as much as possible, and use AJAX.…
-
4
votes1
answer304
viewsA: XOOPS Strict Standards error
A static method is defined thus: class NomeDaClasse { public static function nomeDoMetodo( $argumento ) {} } And must be invoked so: NomeDaClasse::nomedoMetodo( $valorDoArgumento ); In older…
phpanswered Bruno Augusto 8,661 -
6
votes1
answer579
viewsA: How to guarantee unique access to each user?
Through a Handler of custom sessions you can do this because you can perform a different routine at each stage of the session: opening, closing, reading, recording, removing and garbaging. To create…
phpanswered Bruno Augusto 8,661 -
1
votes1
answer703
viewsA: sendmail() php xampp localhost Network with proxy
Judging by the additional options not present by default in PHP.INI I would say that you are using Fake Sendmail for Windows, correct? Assuming yes, as part of an answer in SOEN regarding…
phpanswered Bruno Augusto 8,661 -
2
votes2
answers1326
viewsA: Know if user is connected PHP
The concept of the most basic form of implementation you already have, that is, create a field in the table, even if the table is wrong, which will serve as a condition for creating the session…
phpanswered Bruno Augusto 8,661 -
3
votes2
answers2961
viewsA: How to copy data from another site with PHP?
There are two possibilities: Read the site and analyze it with Regular Expressions Syntactically parse HTML with GIFT or Simplexml The first option is the easiest but not the safest for you because…
phpanswered Bruno Augusto 8,661 -
1
votes2
answers268
viewsA: Large images corrupted or truncated when pulling from SQL server with PHP
I have no experience with MSSQL, but you can try to change the values of these three directives in PHP.INI, preferably one at a time and see which one really worked, so if you do, you will help the…
-
1
votes1
answer1018
viewsA: How to dynamically mark checkbox fields with PHP?
Boy... what a confusing question... First of all, this here: $inbairros = $_GET["bairros"]; if(array_key_exists("bairros", $_GET)){ foreach($inbairros as $baitem => $bavalue) { // select bairros…
-
3
votes2
answers1335
viewsA: Calculation percentage of hours
So far I’ve never experienced a case where using the right tool would be more complicated than using the wrong one. Here comes the story... For this type of calculation you should use the famous…
phpanswered Bruno Augusto 8,661 -
5
votes3
answers806
viewsA: Exchange array value when null
I will leave an alternative not only more efficient (nested loops are bad) but also flexible enough to work with arrays of infinite dimensions: function modify( $param ) { if( is_array( $param ) ) {…
-
1
votes1
answer139
viewsA: imagecrop adds black line
I took the essence of your problem, that is, the imagecrop() bug, to SOEN and asked for an alternative version that, besides not suffering from the same bug still works in versions prior to 5.5 of…
phpanswered Bruno Augusto 8,661 -
1
votes1
answer882
viewsA: Google Pie Charts is not displayed when data has more than one Row
Actually you expected to see something like this: If it is, it’s pretty simple to solve even though it’s not so obvious: Its decimal values are not decimal, they’re numerical strings. Most likely…
-
2
votes1
answer492
viewsA: Problem with mcrypt function*
For those who come to find this topic in the future, what Bacco said in that comment, basically, is to remove all the "garbage" added by the ciphers so that they have the same size which, in code,…
-
6
votes1
answer3366
viewsA: Is it possible to create classes with two constructors?
Let’s go first to the solution of problem. You don’t need two constructors, you just need to do what was done in the last constructor argument: class MysqliDB { public function __construct( $user =…
phpanswered Bruno Augusto 8,661 -
0
votes5
answers16703
viewsA: Fill left zeros in Javascript
Has the implementation PHP str_pad() Javascript made by PHP.JS staff: function str_pad(input, pad_length, pad_string, pad_type) { // discuss at: http://phpjs.org/functions/str_pad/ // original by:…
-
1
votes1
answer623
viewsA: Check alphanumeric characters in field
You didn’t give much information about jQuery Validate, although you explicitly marked the topic with this tag. But also you have not provided us with any basis for work. So I have to consider the…
-
2
votes2
answers90
viewsA: How to identify when someone is uploading to the page?
Assuming you are aware of the low reliability of a condition made exclusively in Javascript, you can run something in the upload field’s onChange() Event: With jQuery…
javascriptanswered Bruno Augusto 8,661 -
6
votes2
answers107
viewsA: Search text in DB without '</ br>'
Assuming I have understood correctly, just reverse what the nl2br() function does. Since there is no native thing, just a simple substitution: $var = str_replace( array( '<br>', '<br/>',…
-
2
votes2
answers84
viewsA: How to insert a REQUIRE in this function?
The fifth argument from add_menu_page(), although defined as function is actually a callable, that is, any function or class method invoked by PHP in the context of the Wordpress API. You chose a…
-
2
votes2
answers616
viewsA: "Convert" an HTML list to Mysql with PHP
I would like to propose an alternative that aims to screw with a screwdriver and not with a hammer, that is, to syntactically analyze a hierarchical structure with a parser for real. This is one of…
-
1
votes1
answer1163
viewsA: Problem with accents in . serialize()
According to the manual of jQuery.() a UTF-8 string is created in the URL-Encoding pattern, also known as Percentage Encoding of all the "successful controls" form. It’s not that your output is…
-
4
votes4
answers817
viewsA: SQL Condition Array - PHP
A similar alternative to by @Peoplee but that does not suffer from the limitation described by it is popular the array in small fragments, following a logic pre-specified by the Application: /** *…
-
3
votes1
answer129
viewsA: How to print array values
This is not an array, it is an object Simplexmlelement which can be iterated as an array, but not through the same square bracket notation as an. Since I don’t have the same XML as you to offer you…
-
4
votes7
answers762
viewsA: Randomize results with PHP
Let me propose another possibility, no manual loops: $ids = range( 1, 9 ); // Define o intervalo shuffle( $ids ); // Embaralha $ids = array_chunk( $ids, 3 ); // Divide em blocos de 3 // Monta a…
-
6
votes1
answer1002
viewsA: Distribute content evenly in tables with php
There is a Structural Design Pattern called Composite which allows you to abstract HTML and build a hierarchical structure of composite information, such as a tree. With Composite you have several…
phpanswered Bruno Augusto 8,661 -
1
votes1
answer163
viewsA: Msxml3.XMLHTTP In which case is it used?
Xmlhttprequest The native object of modern browsers Msxml2.XMLHTTP Also valid as MSXML2.XMLHTTP.3.0 in accordance with the Knowledge base of MSDN this Activex object introduced with MSXML2,…
-
2
votes1
answer118
viewsA: PHP standardization Fig Namespaces
I believe I’m seeing three questions so I’ll answer them in the order that makes the most sense: Directory structure, namespaces and content. Like every framework or component/library, whether…
-
0
votes2
answers153
viewsA: Reorder ID in table after Delete or Insert
Based on the answer above (or below) that will possibly be deleted or incorporated into the initial topic in which you say you intend to recreate this database one day, I believe the reason is more…
phpanswered Bruno Augusto 8,661 -
4
votes3
answers1452
viewsA: Validate URL with ER
For the record, there is no To regular expression to validate Urls and guilt is in part/are of Rfc(s). And so is for any data that relies on a. The filtering functions of PHP even follow the proper…
-
1
votes2
answers46
viewsA: Change image link src
Assuming there is no possibility of that expression 150-150 repeat in any part of the URL, it would be something like this: $( document ).ready( fucntion() { $( 'ul#something li img' ).each(…
jqueryanswered Bruno Augusto 8,661 -
3
votes2
answers1263
viewsA: Convert a string url to hyperlink
I did some digging and found that answer in Stack Overflow which in addition to solving your text-to-link problem still takes into account various particularities of a URL and even covers links of…
-
4
votes6
answers261
viewsA: Parser Bbcode ignore what is inside [code]
Perhaps that answer is MUCH more than you need, but in my opinion it is not enough that you only have a Regular Expression or a solution based on the positions of certain characters (even more so…
-
8
votes3
answers2308
viewsA: What HTTP status should I use for when a POST parameter is missing?
Very interesting stack pointed by @Gypsy. Particularly I support the use of 400 because the server would be responding that received a bad request from the client. But why a bad requisition? Because…
-
1
votes2
answers198
viewsA: PHP: If Result with Function
Assuming I understand your problem, I have an alternative solution based on the class Datetime Its problem seems to revolve around a comparison between the current date and a future date, ie a…
-
2
votes1
answer807
viewsQ: Applying recursion in a batch script
Some time ago I came to the need to use the Microsoft Office Document Imaging to convert a document template created in Microsoft Word as an anti-copy prevention measure of the model itself…
-
2
votes2
answers230
viewsA: Passing the text of the JS fields
Technically this should be a comment, but there are so many points to be considered that it is preferable to write more carefully. Your question is quite confused, but apparently it would suffice,…
-
4
votes2
answers180
viewsA: Why does the universal selector * have a negative impact on browser rendering?
The concept that the universal dial is slow is a myth coined ten years ago when, in fact, there were performance problems, nothing surprisingly, because of Internet Explorer 6. Nowadays, in modern…
-
1
votes3
answers1130
viewsA: Access negative index from an array
I found the reply of @mgibsonbr correct but a little confusing. I will leave my contribution, a translation and adaptation of an answer of Soen, which makes it more evident to Javascript donkeys…