我在这个论坛中找到了这个代码,我正在使用它.它的工作正常,但在法语中,月份是mois,所以它已经有了s.两个ss没有意义.
如果一个单词已经以一个单词结尾,如何阻止它插入?谢谢
function time_elapsed_string($ptime)
{
$etime = time() - $ptime;
if ($etime < 1)
{
return '0 seconds';
}
$a = array( 12 * 30 * 24 * 60 * 60 => 'an',
30 * 24 * 60 * 60 => 'mois',
24 * 60 * 60 => 'jour',
60 * 60 => 'heure',
60 => 'minute',
1 => 'seconde'
);
foreach ($a as $secs => $str)
{
$d = $etime / $secs;
if ($d >= 1)
{
$r = …Run Code Online (Sandbox Code Playgroud) 我有一个数组,我似乎无法从中检索信息.这是一个嵌套数组吗?
print_r()结果:
Array (
[0] => Array (
[0] => Array (
[title] => Hampton
[day] => 1st and 3rd Monday
[time] => 7:30pm
[contact] => Jan Boyd
[phone] => 0438 584 558
[email] =>
)
[1] => Array (
[title] => Frankston
[day] => 1st and 3rd Wed
[time] => 9:30am
[contact] => Vaness Ogues-Canele
[phone] => 0420 834 791
[email] =>
)
)
)
Run Code Online (Sandbox Code Playgroud)
我用来尝试检索信息的代码:
foreach( $groups as $group ) { ?>
<?php echo $group['title'] ?>
<?php echo …Run Code Online (Sandbox Code Playgroud) <?php
mysql_connect("mysql6.000webhost.com","a6124751_murali1","***");
$db= mysql_select_db("a6124751_signup");
$topic=$_GET["Topic"];
$question=$_GET["Question"];
$company =$_GET["Company"];
$query = "INSERT INTO questions (topic, question, company) VALUES ($topic, $question, $company)";
$sql1=mysql_query($query);
if (!$sql1) {
die('Invalid query: ' . mysql_error());
}
?>
Run Code Online (Sandbox Code Playgroud)
这是我在服务器中的php代码,其中有一个名为'questions'的表,我试图从前端使用表单从GET方法获得的输入中插入数据,我可以发现数据来自我使用echo检查的客户端.我收到错误了
您的SQL语法有错误; 检查与您的MySQL服务器版本对应的手册,以便在第1行使用"name,在此输入您的问题,公司"附近使用正确的语法
不知道查询中的错误是什么.任何人都尽快找到它.谢谢
我需要使用分割页面的URL #.
我正在使用location.split("#");但它似乎不适用于jQuery.
我希望得到URL的最后一部分#,例如:
http://example.com/#/hello_world - >/hello_world
我怎样才能做到这一点?
我的代码如下:
#include <stdio.h>
void print_pointer(char **str);
void print_array(char *str[20]);
void print_array2(char str[20][20]);
void print_array3(char str[][20]);
int main(int argc, char *argv[])
{
char str[20][20] = {"test1", "test2", "test3"};
print_pointer(str);
print_array(str);
print_array2(str);
print_array3(str);
return 0;
}
void print_pointer(char **str)
{
int i = 0;
for(; i < 20; i++)
{
printf("%s", str[i]);
}
}
void print_array(char *str[20])
{
int i = 0;
for(; i < 20; i++)
{
printf("%s", str[i]);
}
}
void print_array2(char str[20][20])
{
int i = 0;
for(; i …Run Code Online (Sandbox Code Playgroud) 我正在使用window.location.href加载页面,现在我已切换到window.onload()功能,但页面不加载一些内容.
window.location.href = $(this).val(); 是我正在使用的代码.
如何使用window.onload()函数编写它?