Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Just need help fixing this php code
if ($cmtx_set_name_value == "anonymous")
{
$cmtx_set_name_value = ""
}
thanks
Try adding ; after the assignment.
$cmtx_set_name_value = "";
your code is work fine just put ; to end of line
if ($cmtx_set_name_value == "anonymous"){
$cmtx_set_name_value = "" ; }
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Why can't I call this function with the function and increment it's argument?
It seems to loop endlessly without $i incrementing.
function loopy($i) {
loopy($i+1);
echo $i.'...';
if ($i >=5) return true;
}
Because the if statement needs to go before calling the function again to stop it beign an infinite loop:
function loopy($i) {
if ($i >=5) return true;
loopy($i+1);
echo $i.'...';
}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I receive data in this format like:
C00001,C00302,C00303,C00287,C00286,C00285,C00017
in a variable but i need in this shape:
'C00001','C00302','C00303','C00287','C00286','C00285','C00017'
i am new in mysql kindly any help
You can explode the data, modify it, then re-implode it.
$data = 'C00001,C00302,C00303,C00287,C00286,C00285,C00017';
$arr = explode(',', $data);
$new_arr = array_map(function($a){
return "'{$a}'";
}, $arr);
$new_data = implode(',', $new_arr);
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I'm trying to set the class hidden, unless two factors are met. Currently, I'm using the code below:
<?php
if (isset($_POST['prerequisite']) && $form == "CheckingIn")
{
}
else
{
echo "hidden";
}
?>
How can I fix this to just be an if statement instead of an if/else?
Negate the expression; use the "NOT" logical operator:
if (!(isset($_POST['prerequisite']) && $form == "CheckingIn")) { echo "hidden"; }
(notice the ! symbol)
Read more here: http://php.net/manual/en/language.operators.logical.php
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
$a='Would you like to have responses to your questions sent to you via email'
for($a as $b=>c){
}
Kindly give me the solution
<?php echo substr_count($a, 't'); ?>
Here's a solution, though not necessarily the best
$letterCount = array_count_values(
str_split(strtolower($a))
);
$tCount = (isset($letterCount['t'])) ? $letterCount['t'] : 0;
$count = preg_match_all('/t/', $str);
check this one
<?php
$a = 'Would you like to have responses to your questions sent to you via email';
$t_explod = explode('t', strtolower($a));
echo count($t_explod) - 1;
?>
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
The simple program is not returning the string,Please help.
<?php
function returnStr() {
return "fooBar";
}
$str=returnStr();
echo $str;
}
?>
It's a parse error:
$str=returnStr();
echo $str;
} // WHAT IS THIS BRACKET DOING HERE?
There's a fatal error tokenizing the code due the trailing/unmatched '}' remove that and the code will work. Then spend some time thinking about why you didn't know this already
There's an error in your code. The last } is useless.