Jump to content

fanta1066

Members
  • Posts

    11
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

fanta1066's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok I am giving up, its far to complicated as I am not a PHP coder. And this has taken up to much of my time.
  2. This does not work $values1 = array_column($alpha1, 'Value', 'OID'); $values2 = array_column($alpha2, 'Value', 'OID'); $values3 = array_column($alpha3, 'Value', 'OID'); $values4 = array_column($alpha4, 'Value', 'OID'); foreach ($values1 as $k => $v) { echo "<tr>"; echo "<TD>" . $k . "</td>"; echo "<TD>" . $v . "</TD>"; echo "<TD>" . $values2[$k] . "</td>"; foreach ($values3 as $z => $w) { echo "<TD>" . $z . "</td>"; echo "<TD>" . $w . "</TD>"; echo "<TD>" . $values2[$z] . "</td>"; } echo "</tr>";
  3. Yes I understand, but I have to present all the information in the form of a table. This is another problem. How can I take all that data and present in a table?
  4. I have no idea what that means, can you please kindly give me an example.
  5. I have already posted something similar. However what I did not post was the entire problem, which I have described below. This is far more complicated then my prior post. As explained, I am not a developer. I am a network engineer. I have the following output (below), all that data has been sent to arrays. Each set of output has approximately 1000 entries, some have slightly more. I need some php code which will iterate through each array and (where the BOLD numbers match in all of the arrays, to pull out the data after the Value= Array name = alpha1 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.52, Type=OctetString, Value= 84 B1 E4 6E 93 4F OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.53, Type=OctetString, Value= 1C 6A 76 41 09 B9 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.65, Type=OctetString, Value= 1C 6A 76 45 D6 5D OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.67, Type=OctetString, Value= CE B9 5E 32 17 61 Array name = alpha2 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.52, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.53, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.65, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.67, Type=OctetString, Value=svc_rover@gstt.local Array name = alpha3 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.4.10.36.240.52, Type=OctetString, Value=ROLE-GSTT-PLOCAL-WIFI OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.4.10.36.240.53, Type=OctetString, Value=ROLE-GSTT-PLOCAL-WIFI OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.4.10.36.240.65, Type=OctetString, Value=ROLE-GSTT-PLOCAL-WIFI OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.4.10.36.240.67, Type=OctetString, Value=ROLE-GSTT-PLOCAL-WIFI Array name = alpha4 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.5.10.36.240.52, Type=TimeTicks, Value=4 days, 0:35:49.00 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.5.10.36.240.53, Type=TimeTicks, Value=3 days, 7:32:33.00 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.5.10.36.240.65, Type=TimeTicks, Value=8:20:48.00 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.5.10.36.240.67, Type=TimeTicks, Value=3 days, 7:26:52.00 Array name = alpha5 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.6.10.36.240.52, Type=Integer, Value=4 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.6.10.36.240.53, Type=Integer, Value=4 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.6.10.36.240.65, Type=Integer, Value=4 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.6.10.36.240.67, Type=Integer, Value=4 Array name = alpha6 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.7.10.36.240.52, Type=OctetString, Value=HH.Porters.2022 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.7.10.36.240.53, Type=OctetString, Value=F.11.P.G OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.7.10.36.240.65, Type=OctetString, Value=F.2.P.G OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.7.10.36.240.67, Type=OctetString, Value=HH.MAPLE.WARD.DOSA.BEDS Array name = alpha7 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.9.10.36.240.52, Type=Integer, Value=3240 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.9.10.36.240.53, Type=Integer, Value=3240 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.9.10.36.240.65, Type=Integer, Value=3240 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.9.10.36.240.67, Type=Integer, Value=3240 Thank you for all your help.
  6. Apologies, its now working. Thank you very much for all your help. May I ask you another question please?
  7. Hi Barand, I have tried both solutions you have kindly offered. However when I try each one, I only get the following output OID Val 1 Val 2
  8. Hi Barand, thank you for your prompt response. I see you live in Cheshire. I use to live in Winsford, Cheshire. Where do you live? When you say, That's the hard part done. Now it's just a matter of looping through one array and looking for matches in the other, can you please show me how to do this? In regards to your question, the data was produced by SNMP queries against a master switch.
  9. Hi, I am a network engineer not a coder. Having said that, there are times when I need to write some basic code to get me particular data. I have looked here for a solution https://thispointer.com/check-if-array-contains-a-substring-in-php/ Though, I am not able to find a working solution. So can you help me plz?
  10. So I am struggling. I have the following data in an array called $alpha1 (approx 1000 entries) OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.12.15.161, Type=OctetString, Value= D8 B0 53 C4 01 E5 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.15.65.47, Type=OctetString, Value= 5C D0 6E F0 F9 2E OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.52, Type=OctetString, Value= 84 B1 E4 6E 93 4F OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.53, Type=OctetString, Value= 1C 6A 76 41 09 B9 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.59, Type=OctetString, Value= 84 B1 E4 70 C7 D9 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.60, Type=OctetString, Value= 6C 7E 67 41 27 C3 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.2.10.36.240.67, Type=OctetString, Value= CE B9 5E 32 17 61 In a second array $alpha2, I have the following data (approx 1000 entries) OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.12.15.161, Type=OctetString, Value=GA871 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.15.65.47, Type=OctetString, Value=MC990 OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.52, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.53, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.59, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.60, Type=OctetString, Value=svc_rover@gstt.local OID=.1.3.6.1.4.1.14823.2.2.1.1.2.1.1.3.10.36.240.67, Type=OctetString, Value=svc_rover@gstt.local What I require is some php code to do the following, loop through all the entries in $alpha1 and if (where I have bold and underlined the text, a match is found in $alpha2, then to extract the text which I have bold and italics from both $alpha1 and $alpha2? I am using PHP 7.3.1 Thank you
  11. Can some one please advise me with some sample code. Basically I have a table in MYSQL and within this table I have a field called record_number. Obviously its an Integer and it auto increments. within an HTML form with php code all I want is to display the value of this field + 1 So in other words if the value of record_number is 15 in the table and when the HTML form is launched the PHP code will interrogate the table get the value and some where on my form it will state the following. Record Number = 16 Please can some one give me some real code that I could use. thanks Please email code to h.ghelani@rbht.nhs.uk
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.