我有6张桌子:
CREATE TABLE IF NOT EXISTS `sbpr_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`active` tinyint(1) DEFAULT '0',
`dnd` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=32 ;
CREATE TABLE IF NOT EXISTS `sbpr_newsletter` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`from` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`mail` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`subject` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`body` text COLLATE utf8_unicode_ci,
`attach1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, …Run Code Online (Sandbox Code Playgroud) 谁能帮助我使用sed程序获取子串?
我有一个这行文件:
....
define("BASE", "empty"); # there can be any string (not only "empty").
....
Run Code Online (Sandbox Code Playgroud)
我需要将"空"作为字符串变量添加到我的bash脚本中.
这时我有:
sed -n '/define(\"BASE\"/p' path/to/file.ext
# returns this line:
# define("BASE", "empty");
# but I need 'empty'
Run Code Online (Sandbox Code Playgroud)
UPD:感谢@Jaypal
现在我有bash脚本:
DBNAME=`sed -n '/define(\"BASE\"/p' path/to/file.ext`
echo $DBNAME | sed -r 's/.*"([a-zA-Z]+)".*/\1/'
Run Code Online (Sandbox Code Playgroud)
它工作正常,但如果有任何方法使用一行代码进行相同的操作?
当与SplFixedArray一起使用时,我看到了一些奇怪的行为($ arr,COUNT_RECURSIVE).以这段代码为例,......
$structure = new SplFixedArray( 10 );
for( $r = 0; $r < 10; $r++ )
{
$structure[ $r ] = new SplFixedArray( 10 );
for( $c = 0; $c < 10; $c++ )
{
$structure[ $r ][ $c ] = true;
}
}
echo count( $structure, COUNT_RECURSIVE );
Run Code Online (Sandbox Code Playgroud)
结果...
> 10
Run Code Online (Sandbox Code Playgroud)
你会期望110的结果.这是正常的行为,因为我正在嵌套SplFixedArray对象吗?
我已经设置了自定义背景图片的提交按钮.但它在不同的浏览器上显示不同.
几乎所有浏览器都显示正确:

但在2它有额外的高度:

任何人都可以指出我的标记有什么问题吗?
CSS:
input[type="submit"]{
background: url(http://dl.dropbox.com/u/17055243/icons.png) -99px 0px no-repeat;
width:30px;
height:30px;
border:none;
float:left;
margin:30px 0 0;
cursor:pointer;
}
Run Code Online (Sandbox Code Playgroud)
HTML:
<form>
<input type="text" class="placeholder" value="Search" />
<input type="submit" value="" />
</form>
Run Code Online (Sandbox Code Playgroud)
测试:
任何人都可以帮我列表.
我有一张图片:

现在我需要构建列表,默认公牛用左侧箭头替换(但不是整个图像):

我如何使用跨浏览器css实现它?
我的HTML标记是:
<ul>
<li><a href="#">Conveniently located on Adelaide St. W, one block east of the Bathurst and Adelaide intersection, just north of the Gardiner Expressway, downtown Toronto.</a></li>
<li>All units are located indoors, which means they are all climate controlled.</li>
<li>There is an indoor loading dock with four bays, two of which are large enough to accommodate up to 50' trailers.</li>
<li>Complimentary use of on-site dollies and pallet truck.</li>
</ul>
Run Code Online (Sandbox Code Playgroud) 我有两个变量:
$qty = 7;
$_POST['qty'] = 6;
var_dump($qty, $_POST['qty']); // both vars are integers
$_SESSION['qty'] = $qty + $_POST['qty'];
echo '='.$_SESSION['qty'];
Run Code Online (Sandbox Code Playgroud)
返回:
int(7) int(6) =1
Run Code Online (Sandbox Code Playgroud)
(int)$qty, (int)$_POST['qty'] 没有解决问题.
我究竟做错了什么?
更新:
... intval($qty) + intval($_POST['qty']);
Run Code Online (Sandbox Code Playgroud)
没有帮助.
我还注意到一个细节.问题只有在$ _SESSION ['qty']> = 10时才会出现问题:
$_SESSION['qty'] = $qty + $_POST['qty']; // $qty = 3, $_POST['qty'] = 6
Run Code Online (Sandbox Code Playgroud)
返回好结果($ _SESSION ['qty'] = 9).
谢谢你的帮助.但问题更多不实际(这是一个服务器问题).无论如何+1全部.