I am coding an app for a friend, and SQL is not my strong suit. I thought that I had laid this matter to rest with my previous question, which received an excellent answer. However, my friend has moved the goal posts yet again (and swears that it is final this time). Given these tables The user inputs a text
Tag: parsing
Parsing a boolean expression into a MySql query in PHP
These are the only two tables that are germane. No need to bother you with the others. Basically, users enter a boolean search string, using skill names. I will convert the skill snames to skill_id, and then want to generate a MySql query to get all matching job_id from table skill_usage, by parsing the user&…
Parse JSON data inside from occurrence of script tag using SimpleHtmlDom – PHP
I am using simple html dom to parse a link that contains two script tags with type=application/ld+json. The target website structure is like below, // tag that I want to parse
PHP Get Text Between Tags + The Tags Themselves
I want to get all text between [tag] and [/tag] including the tags. So this sentence. The cat said [tag]hi to dog[/hi] at the park. Using this function. function get_string_between($string, $start,…
Replace pairs of symbols in chat text with html tags to style as bold, italic, and strikethrough
I am trying to make a whatsapp style text post. When user create text like this: then this text is automatically changing like this Hi how are you where are you I know i can do it with php regex like this: The example is for bold text: But there is a problem it should be remove * when text
Scraping tag with certain keyword using Simple HTML Dom Parser
I’m attempting to scrape a <script> tag from a set of webpages using Simple HTML Dom. At first, I was scraping it by providing the numerical order of the tag I needed: I’ve come to realize that the order differs depending on the page (and it’s just not a scalable way of doing this sinc…
simplexml_load_file does not recognize tags
I am trying to use simplexml_load_file() to load an XML file and reach <dc:title> tags, but when I dump the $xml variable that loaded my xml file all the tags that starts with <dc: doesn’t show. Is there a way of telling the parser to include them? should I use a different parser? Here’s …
PHP parse/syntax errors; and how to solve them
Everyone runs into syntax errors. Even experienced programmers make typos. For newcomers, it’s just part of the learning process. However, it’s often easy to interpret error messages such as: PHP Parse error: syntax error, unexpected ‘{‘ in index.php on line 20 The unexpected symbol is…
PHP Cleaning special characters from string
so I made this scraper and it returns strings from multiple sites. I want to check if the strings match, so I use php to clean the string and check. However, the & and other special characters appear in 2 ways, one as & and the other as &. How do I go about removing each type. I already have
Parsing Wikipedia Page tables issue
Hi I’m trying to parse a Wikipedia document in which there is a table called “infobox biota” with this structure. I’m trying to get the following table data and classes of the following …