Home Set Condition to values php
Reply: 0

Set Condition to values php

user8324
1#
user8324 Published in September 20, 2018, 10:52 pm

I have arrays and this arrays have values i need to set Condition to values like that my arrays keys variable and Are changing !

And i want check if my custom value exist print somthing...

 if ($arraysValue[$keys] ==1) { print "one"; }
 //OR
 if ($arraysValue[$keys] ==3) { print "three"; }

Arrays :

Array
(
    [0] => 1
    [3] => 2
    [6] => 3
    [9] => 4
    [12] => 5
    [15] => 8
    [18] => 9
)
Array
(
    [0] => 1
    [4] => 2
    [8] => 6
    [12] => 9
)

Thanks for any help...

share|improve this question
  • Unclear $arraysValue ==1?? – Yash Parekh Feb 14 at 8:58
  • $arraysValue[$keys] problem is keys are changing! – Bijan Zand Feb 14 at 8:59
  • Not very clear what you want to do. Are you trying to check if a key exists in an array? Or if a value exists in an array? Or something else? – JJJ Feb 14 at 8:59
  • yes i want check if my custom value exist print somthing ! – Bijan Zand Feb 14 at 9:00
  • He wants to print digit in alphabet as like if 1 then script should print one. For that task you will have to create array for alphabet – Ayaz Shah Feb 14 at 9:01

2 Answers 2

active oldest votes
up vote 2 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.3078 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO