我知道有 strcmp 但它只是让我比较两个字符串,而且我需要比较很多字符串
这个不起作用:
if(strcmp (resposta, "S" || "s" || "N" || "n")== 0)
printf("Resposta = S");
else
printf("Resposta != S");
printf("\nfim");
Run Code Online (Sandbox Code Playgroud) 我需要将变量的结果保存$res到一个多维数组中然后保存在json_encode.
<?php
include("config.inc");
$query = "SELECT * FROM accounts ";
$res = mysql_query($query);
$arr = array(array($res));
echo json_encode($arr);
mysql_close($con);
?>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?如何保存$res到阵列中?谢谢
哦,我也需要以这种方式显示:["aa","bb","cc"] ["aa","bb","cc"]它将被保存到程序内的表中