这个问题与我之前的问题类似.但有几个变种(我有高级JOIN的探针,我在论坛中找不到任何有用的信息).
同样,我更改了表,字段和值的名称,只保留了数据库的结构供您理解.
现在,让我们假设我有这个(我不能改变结构):
.
ID | AGE | COUNTRY
1 | 25 | usa
2 | 46 | mex
...
Run Code Online (Sandbox Code Playgroud)
.
ID | PERSON_ID | CATEGORY | FOOD | UNITS
1 | 1 | fruit | apple | 2
2 | 1 | fruit | grape | 24
3 | 1 | fruit | orange | 5
3 | 1 | fast | pizza | 1
4 | 1 | fast | hamburguer | 3
5 …Run Code Online (Sandbox Code Playgroud) 我已经在 上安装了 WordPress,http://example.com并且该站点是多语言的,因此您可以在 访问英文网页http://example.com/en/something-here/,也可以在 访问该网页的西班牙语版本http://example.com/es/algo-aqui/。
我想安装 Codeigniter 4,http://example.com/software/但我想保留一般网站 URL 结构,因此我需要能够通过 URLhttp://example.com/en/software/和http://example.com/es/software/. 始终阅读本段开头提到的相同 CI4 安装。
我部署了 CI4 文件http://example.com/software/并修改了.htaccessWordpress 站点和 Code Igniter 的文件。
这是我的.htaccess根目录下的 WP 文件:
# Disable directory browsing\nOptions All -Indexes\n\n<IfModule mod_rewrite.c>\nRewriteEngine On\n RewriteBase /\n RewriteCond %{REQUEST_FILENAME} !-f\n RewriteCond %{REQUEST_FILENAME} !-d\n RewriteRule ^[a-z]{2}/software(.*)$ /software/index.php$2 [L]\n</IfModule>\n\n# BEGIN WordPress\n# Las directivas (l\xc3\xadneas) entre `BEGIN WordPress` …Run Code Online (Sandbox Code Playgroud) 我有一个包含HTML内容的数据库,它有一些带链接的文本.有些文本的URL中有哈希符号,有些则没有.
我需要删除带有哈希符号的链接,保留那些没有哈希符号的链接.
例:
输入:
<a href="http://example.com/books/1">The Lord of the Rings</a>
<ul>
<li><a href="http://example.com/books/1#c1" >Chapter 1</a></li>
<li><a name="name before href" href="http://example.com/books/1#c2">Chapter 2</a></li>
<li><a href="http://example.com/books/1#c3" name="name after href">Chapter 3</a></li>
<li><a href="http://example.com/books/1#cN" target="_blank">Chapter N</a></li>
</ul>
<br><br>
<a href="http://example.com/books/1">Harry Potter</a>
<ul>
<li><a href="http://example.com/books/2#c1" target="_self">Chapter 1</a></li>
<li><a href="http://example.com/books/2#c2" name="some have name" title="some others have title" >Chapter 2</a></li>
<li><a href="http://example.com/books/2#c3">Chapter 3</a></li>
<li><a href="http://example.com/books/2#cN" >Chapter N</a></li>
</ul>
Run Code Online (Sandbox Code Playgroud)
期望的输出:
<a href="http://example.com/books/1">The Lord of the Rings</a>
<ul>
<li>Chapter 1</li>
<li>Chapter 2</li>
<li>Chapter 3</li>
<li>Chapter N</li>
</ul>
<br><br> …Run Code Online (Sandbox Code Playgroud)