Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
Is there a way to make something like this:
$bob = $request->bob;
return $bob in_array()....
to resolve to something like
return ! in_array()....
or
return in_array()....
base on the variable value...
You can use ?:
return $variable ? in_array('x', $some_arr) : !in_array('x', $some_arr);
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Way 1:
public $foo = 1;
function(){
return $this->foo+1;
}
Way 2:
// with $foo = 1 in other function
function($foo){
return $foo+1;
}
Sorry for a 'dumb' question, someone can tell me what is the better way?
Second way is better and it is more canonical than first one. For more information please read this doc http://php.net/manual/en/functions.arguments.php
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
http://example.com/geturl.php?url=http://example.org/index.php?parafile=1698%3A1562%3A0%3A0¶_action=print_ticket¶file=dance://here.kodas/print&token=3ec2b0d3e6e0ca152bc024cc3f30f16c
So i want each of this parameters in a different varaible in the geturl.php file. I am using the regular get url
You can use anything like this :
$url = "http://example.com/geturl.php?url=".urlencode($urlPart);
$_server[QUERY_STRING] solved my problem
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
so I would like to use something like /action=productSpec?product=1
And then echo the value "1".
I have this:
case "productSpec":
$show = $_GET['product']
echo $show;
break;
But it doesn't work.
Why? Thank you.
"Case is also GET";
Change that part in the URL to ?action=productSpec&product=1
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Here is my code:
(($order['financial_status']!='partially_refunded')?$order['fulfillments'][0]['updated_at']:null)
Here, I want to check, refunded and partially_refunded by using or operator.
Can anyone help me?
Thanks.
If I understand you correctly, it's not bitwise you need, but a simple if conditional statement:
if ($order['financial_status'] !== 'partially_refunded' ||
$order['financial_status'] !== 'refunded') {
// Do something with $order['fulfillments'][0]['updated_at']
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
is there any way i can get the id inside this code:
header('Location: assigned.php?success?$ticket_id');
I am new to PDO. sorry for the simple question
You are adding ? twice. it should be like..
header('Location: assigned.php?success='.$ticket_id);