I Have a form with one textbox called(ProductTitle) if I write as example “Étuit” in the textbox and click on Save, I post the data in a table called Product. The result int the database for …
scrape data using regex and simplehtmldom
i am trying to scrape some data from this site : http://laperuanavegana.wordpress.com/ . actually i want the title of recipe and ingredients . ingredients is located inside two specific keyword . i am trying to get this data using regex and simplehtmldom . but its showing the full html text not just the ingre…
php str_replace replacing itself
I need to replace every occurrence of one of the letters a,o,i,e,u with [aoieu]? I tried to do the following: But when giving it input of black instead of giving me the expected bl[aoieu]?ck it gave me How can I get it to not replace things it already replaced? Answer You can consider using a regular expressi…
PHP encapsulation without class?
Is it possible to encapsulate, a variable or function let say, in PHP without wrapping them in a class? What I was doing is: My intention is to avoid naming conflict. This routine, although it works, makes me tired. If I cannot do it without class, it is possible not to instantiate a class? and just use the v…
Is there any benefit in using PHP comments over HTML comments in HTML code? [closed]
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, …
hash in JS == hash in PHP
I need to make a hash with JS and PHP but I need them to both work out to be the same hash. I am just wondering what the best idea would be to go about it. it needs to be secure, but its not hashing …
How to optimize a query with MySQL multi-query?
I need to optimize a script for high performance so the question is how can I add MySQL multi-query to this code? Answer If you’re using mysqli or PDO already, you should be using prepared statements for your queries since they are supported. This will also have a slight increase in performance since th…
Handwritten text recognition php
I am thinking of creating a certain web system. It involves a lot of different (random) people uploading scanned documents of stuff they wrote. Is there any PHP open source way converting these handwritten texts to machine text? I found this question but would like to know if it is capable of recognizing a lo…
PDO Mysql prepared statement last_insert_id returns wrong value on multi-insert?
I noticed that if I prepare a multi-insert statement and execute it into MySQL via PDO, and then request the last_insert_id, I get the first ID of the multiple inserted rows, not the last one. Specifically: will create these rows on an empty table: But the last_insert_id will return “1”. Is this a…
Sending Javascript Object to PHP via Ajax
I’m learning Ajax by failure and have hit a wall: I have an array (if it matters, the array is storing number id’s based on what checkboxes the user checks) that is written in Javascript. I have a function that is called when the user clicks the ‘save’ button. The function is as follow…