Convert PHP closing tag into comment

Use a trick: concatenate the string from two pieces. This way, the closing tag is cut in two, and is not a valid closing tag anymore. ‘?>’ –> ‘?’.’>’ In your code: $string = preg_replace(‘#<br\s*/?’.’>(?:\s*<br\s*/?’.’>)+#i’, ‘<br />’, $string); This will make // comments work. For /* */ comments to work, you’d have to split the … Read more

What is the most efficient way to store tags in a database?

One item is going to have many tags. And one tag will belong to many items. This implies to me that you’ll quite possibly need an intermediary table to overcome the many-to-many obstacle. Something like: Table: Items Columns: Item_ID, Item_Title, Content Table: Tags Columns: Tag_ID, Tag_Title Table: Items_Tags Columns: Item_ID, Tag_ID It might be that … Read more

How to remove all git origin and local tags?

Delete All local tags. (Optional Recommended) git tag -d $(git tag -l) Fetch remote All tags. (Optional Recommended) git fetch Delete All remote tags. # Note: pushing once should be faster than multiple times git push origin –delete $(git tag -l) Delete All local tags. git tag -d $(git tag -l)

using href links inside tag

UPDATE 2022: This answer is fine but really in 2022 we shouldn’t be doing this anymore! UPDATE (May 2020): Someone asked in the comments why I wouldn’t advocate this solution. I guess it’s a question of semantics. I’d rather my users navigate using <a> and kept <select> for making form selections because HTML elements have … Read more

Database Design for Tagging [closed]

Here’s a good article on tagging Database schemas: http://howto.philippkeller.com/2005/04/24/Tags-Database-schemas/ along with performance tests: http://howto.philippkeller.com/2005/06/19/Tagsystems-performance-tests/ Note that the conclusions there are very specific to MySQL, which (at least in 2005 at the time that was written) had very poor full text indexing characteristics.

Is it sometimes bad to use ?

The main reason for not using <br> is that it’s not semantic. If you want two items in different visual blocks, you probably want them in different logical blocks. In most cases this means just using different elements, for example <p>Stuff</p><p>Other stuff</p>, and then using CSS to space the blocks out properly. There are cases … Read more

What is the difference between google tag manager and google analytics?

Google Analytics‘ main job is really just generating the reports and statistics about your website, like how many people saw your website yesterday, what web browser they used, which pages were the most popular, etc. The only way it can know this stuff is if you put a “tag” on all of your pages. The … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)