我试图将日期从yyyy-mm-dd转换为dd-mm-yyyy(但不是在SQL中); 但我不知道日期函数如何需要时间戳,我无法从此字符串中获取时间戳.
这怎么可能?
我在混合HTML和PHP中工作很多,而且大多数时候我只想要带有一些PHP变量的可靠HTML,所以我的代码如下所示:
<tr><td> <input type="hidden" name="type" value="<?php echo $var; ?>" ></td></tr>
Run Code Online (Sandbox Code Playgroud)
这很难看.是不是有更短的东西,更像是以下?
<tr><td> <input type="hidden" name="type" value="$$var" ></td></tr>
Run Code Online (Sandbox Code Playgroud)
这是可能的,但你会陷入困境""(你必须全部替换它们'')并且布局消失了
echo "<tr><td> <input type="hidden" name="type" value="$var" ></td></tr>"
Run Code Online (Sandbox Code Playgroud)
有更好的吗?
我正在制作一种方法,因此您的密码至少需要一个标题和一个符号或数字.我正在考虑将字符串拆分为丢失字符,然后使用preggmatch计算它是否包含一个大写和符号/数字.
但是我在动作脚本中做了类似的事情,但无法弄清楚如何在php中调用它.我无法找到一种方法将一个单词的每个字符串放在一个数组中.
AS3的例子
for(var i:uint = 0; i < thisWordCode.length -1 ; i++)
{
thisWordCodeVerdeeld[i] = thisWordCode.charAt(i);
//trace (thisWordCodeVerdeeld[i]);
}
Run Code Online (Sandbox Code Playgroud)
谢谢,Matthy
在PHP中,您可以调用函数.通过使用这些语句不调用所有参数.
function test($t1 ='test1',$t2 ='test2',$t3 ='test3')
{
echo "$t1, $t2, $t3";
}
Run Code Online (Sandbox Code Playgroud)
你可以使用这样的功能
test();
Run Code Online (Sandbox Code Playgroud)
所以我只想说我希望最后一个是不同的而不是其他的.我能做到的唯一方法是做到这一点,但没有成功:
test('test1','test2','hi i am different');
Run Code Online (Sandbox Code Playgroud)
我试过这个:
test(,,'hi i am different');
test(default,default,'hi i am different');
Run Code Online (Sandbox Code Playgroud)
做这样的事情的最佳方法是什么?
我需要从这个邮箱字符串中提取电子邮件地址.我想到了,str_replace但显示名称和电子邮件地址不是静态的,所以我不知道如何使用正则表达式.
示例:" My name <email@example.com>"应导致" email@example.com".
有任何想法吗?
谢谢Matthy
我尝试使用jquery创建一个对话框,但是我没有成功,只需要点击它就可以弹出它.
<script type="text/javascript">
$.ui.dialog.defaults.bgiframe = true;
$(function() {
$("#dialog").dialog();
});
</script>
Run Code Online (Sandbox Code Playgroud)
和
<div id="dialog" title="Basic dialog">
<p>hi how are you</p>
</div>
Run Code Online (Sandbox Code Playgroud)
并为漂亮的按钮
<button id="create-user" class="ui-button ui-state-default ui-corner-all">Profiel Matthijs</button>
Run Code Online (Sandbox Code Playgroud)
尝试使用这些例子
http://jqueryui.com/demos/dialog/
http://jqueryui.com/demos/dialog/#modal-form
任何人都知道如何通过点击#create-user按钮来实现这一点我不是很擅长javascript.
谢谢Matthy
它可能很简单,但我找不到它.我想制作一个.htaccess文件,这样就无法进入该文件夹了.除了服务器上的PHP.
有谁知道代码行?
谢谢Matthy
嗨,我有一个循环,我想知道是否有一个命令,你可以跳回到循环的开始,并忽略循环中的其余代码
例:
for ($index = 0; $index < 10; $index++)
{
if ($index == 6)
that command to go the start of the loop
echo "$index, ";
}
Run Code Online (Sandbox Code Playgroud)
应该输出
1,2,3,4,5,7,8,9并跳过六个
结果与...相同
for ($index = 0; $index < 10; $index++)
{
if ($index != 6)
echo "$index, ";
}
Run Code Online (Sandbox Code Playgroud)
是否有命令?
谢谢,很好
我有很多功能和课程,我已经包含在我的网站上.在stackoverflow的帮助下,我收到了一个自动包含文件夹及其子文件夹中所有文件的脚本:PHP:Automatic Include
在测试脚本时,它始终有效,我从来没有遇到任何问题.但是最近从Windows服务器切换到Linux服务器时,它会产生类扩展的问题.
PHP致命错误:在第3行的路径/函数/类/ Acumulus/AcumulusExportWorkshop.php中找不到类'AcumulusExportBase',引用:pagesite /?page_id = 346
AcumulusExportWorkshop从AcumulusExportBase扩展而来.这一切都完全适用于Windows,但拒绝在Linux上工作.
我可以解决这个问题,创建一个include_once'AcumulusExportBase.php'; 但如果有一个更好的解决方案,那么这一切似乎都是不必要的,并且正在努力.
我使用的代码如下:
load_folder(dirname(__FILE__));
function load_folder($dir, $ext = '.php') {
if (substr($dir, -1) != '/') { $dir = "$dir/"; }
if($dh = opendir($dir)) {
$files = array();
$inner_files = array();
while($file = readdir($dh)) {
if($file != "." and $file != ".." and $file[0] != '.') {
if(is_dir($dir . $file)) {
$inner_files = load_folder($dir . $file);
if(is_array($inner_files)) $files = array_merge($files, $inner_files);
} else {
array_push($files, $dir . $file);
}
}
} …Run Code Online (Sandbox Code Playgroud)