Posts by bruno santos • 61 points
8 posts
-
0
votes2
answers796
viewsA: How to separate a string by commas, except when you have a space later
Will it always be in this format? If yes you can use this code: var string = "1,0,true,yes, please"; var array = []; var preservado = string.substr(string.indexOf(", ") - 3); array =…
-
1
votes2
answers74
viewsQ: SQL query, count the amount of existing values of a Foreign Key for each corresponding Primary Key in 1 query
Example with 2 tables: table admin: columns: | id_admin | email | password | values: | 1 | ex@ex | 123 | | 2 | ex2@ex2 | 123 | table news: columns: | id_news | title | content | admin_id_admin |…
-
0
votes1
answer23
viewsQ: Generate array with substring positions
There’s some way I can pick up a string, like, "John went to the bar last night". Generate an array that stores the position of all " of that string. I will use this to put in these positions for…
-
0
votes0
answers27
viewsQ: Delete line according to date difference in Mysql
I am trying to delete lines from a table using as a reference the difference between the current date and the date the line was registered. Here is my code: DELETE FROM lixeira WHERE diferenca >…
-
-1
votes1
answer39
viewsA: Autoplay in audio after consultation
I don’t know how you did the code, but I did a test here and it worked normally, even though it was in another tab: <audio id="myaudio" controls style="display: none;"> <source…
-
2
votes1
answer703
viewsA: Scroll up/down bar slowly via link
You can use Jquery’s "Scrolltop" to perform the animation and finish it at any time with "stop()": <div> <a id="subir" style="position: fixed;">subir</a> <a id="descer"…
-
0
votes4
answers2757
viewsQ: How to catch last word of a string in PHP?
For example: "JOHN DOE OF SUCH". I wish to take only the word "SUCH".
-
0
votes2
answers60
viewsQ: How can I check if within one string there are others?
In javascript, I want to check if in a string there is at least one of the following strings: . com, . edu, . br, etc... if one of these strings exists in the main string, I want it to come back…