我需要使用preg_match_all打印所有匹配项.
$search = preg_match_all($pattern, $string, $matches);
foreach ($matches as $match) {
echo $match[0];
echo $match[1];
echo $match[...];
}
Run Code Online (Sandbox Code Playgroud)
问题是我不知道我的字符串中有多少匹配,即使我知道并且如果它是1000,那么键入所有那些将是相当愚蠢$match[]的.
我正在使用blueimp multiple file uploader,一切都很好.但是在某些情况下我必须使用单个文件上传.是否有某种选项我可以触发禁用插件的多文件部分?
重要的是流量不会改变.所以我可以继续使用它,但很容易就可以禁用多个文件.
我想提一下,如果超过maxx文件号,我不想给出错误.我只想一起禁用多个文件.
任何帮助将不胜感激.
我有一个像这样的表的小应用程序:
<tr>
<td><img class='DeleteButton' alt=delete src='images/delete_icon.png'/></td>
<td class='toHide'>some Data</td>
<td class='toHide'>some Data</td>
<td class='toHide'>some Data</td>
<td>some Data</td>
<td class='toHide'>some Data</td>
<td>some Data</td>
<td>some Data</td>
<td class='toHide'>some Data</td>
<td class='toHide'>some Data</td>
<td class='toHide'>some Data</td>
<td class='toHide'>some Data</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
当我在表中添加新数据时,我创建了一个包含"建议"的列表 - 来自其他数据表的数据.
但是如果我有3个表(A,B,C),并且一些数据(D)在A和B中,并且当我想将D添加到C时,在建议列表中有D两次.
那么如何在表中找到重复的行以及如何以最有效的方式执行此操作?
(只有td-tags没有class toHide问题)
到目前为止,我已经使用jQuery来获取建议列表
$("all the tables").not(myTable).each(function(){
$(".suggestData table").append($(this).html());
}
Run Code Online (Sandbox Code Playgroud) 我正在试验以下种子来自https://github.com/NathanWalker/angular2-seed-advanced
我有以下src文件:
app.component.ts
import { ChangeDetectionStrategy } from 'angular2/core';
import { RouteConfig } from 'angular2/router';
import { NameListService } from '../../frameworks/app.framework/index';
import {
RouteComponent, AnalyticsService
} from '../../frameworks/core.framework/index';
import { LangSwitcherComponent } from '../../frameworks/i18n.framework/index';
import { NavbarComponent } from './navbar.component';
import { ToolbarComponent } from './toolbar.component';
import { HomeComponent } from '../home/home.component';
import { AboutComponent } from '../about/about.component';
import { PatientComp } from '../../frameworks/epimss.framework/components/reg/patient/patient.comp';
@RouteComponent({
selector : 'sd-app',
viewProviders : [NameListService],
templateUrl : './components/app/app.component.html',
directives : [LangSwitcherComponent, NavbarComponent, ToolbarComponent], …Run Code Online (Sandbox Code Playgroud) 我在悬停时切换一个元素上的类,该类添加得很好,但margin-top似乎只是被忽略了.如何使margin-top样式正常工作?我的代码在这里@ jsfiddle.代码只是一个片段.
CSS:
#nav ul {
display: inline;
list-style: none;
}
#nav li {
float:left;
width:100px;
height:100px;
margin-top:0px;
margin-right:50px;
}
.hover {
background-color: red;
margin-top: 100px;
}
Run Code Online (Sandbox Code Playgroud)
jQuery的:
$('#nav ul a li').hover(function () {
$(this).toggleClass('hover');
});
Run Code Online (Sandbox Code Playgroud)
HTML:
<div id="nav">
<ul> <a href="">
<li>
<h3>title</h3>
<p>description.</p>
</li>
</a>
<a href="">
<li>
<h3>title</h3>
<p>description.</p>
</li>
</a>
<a href="">
<li>
<h3>title</h3>
<p>description.</p>
</li>
</a>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)