-1

I want to print a array in html and to echo in php .

it cannot show the complete message in html and in php

my code,

<body>
<p>

#<SNMP::SNMPv1_Trap:0x278a2258 @enterprise=[1.3.6.1.4.1.9.9.41.2], @timestamp=#<SNMP::TimeTicks:0x16c779e6 @value=1877211447>, @varbind_list=[#<SNMP::VarBind:0x30066c8e @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.2.0], @value="ROUTING-MSDP">, #<SNMP::VarBind:0x46681034 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.3.0], @value=#<SNMP::Integer:0x6b4d4956 @value=6>>, #<SNMP::VarBind:0x7fda94e8 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.4.0], @value="INIT_STDBY_PEER_UP_DOWN">, #<SNMP::VarBind:0x7cbbe581 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.5.0], @value="down: : received socket disconnect notification ">, #<SNMP::VarBind:0x7ad4b392 @name=[1.3.6.1.4.1.9.9.41.1.2.31.6.0], @value=#<SNMP::TimeTicks:0x7b525267 @value=1877211368>>],  , @agent_addr=#<SNMP::IpAddress:0x5084f431 @value="\xD3O0\x83">, @generic_trap=6>
</p> 
<br>

<?php 
echo "#<SNMP::SNMPv1_Trap:0x278a2258 @enterprise=[1.3.6.1.4.1.9.9.41.2], @timestamp=#<SNMP::TimeTicks:0x16c779e6 @value=1877211447>, @varbind_list=[#<SNMP::VarBind:0x30066c8e @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.2.0], @value=>, #<SNMP::VarBind:0x46681034 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.3.0], @value=#<SNMP::Integer:0x6b4d4956 @value=6>>, #<SNMP::VarBind:0x7fda94e8 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.4.0], @value=">, #<SNMP::VarBind:0x7cbbe581 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.5.0], @value="peer down:: received socket disconnect notification ">, #<SNMP::VarBind:0x7ad4b392 @name=[1.3.6.1.4.1.9.9.41.1.2.31.6.0], @value=#<SNMP::TimeTicks:0x7b525267 @value=1877211368>>],  , @agent_addr=#<SNMP::IpAddress:0x5084f431 @value="\xD3O0\x83">, @generic_trap=6>";
?>
 </body>
matt.crawfoord
  • 87
  • 1
  • 3
  • 13

1 Answers1

0

I suggest you to use javaScript here with the escape sequences as per the guidelines given in this Page:

Alter the following line with escape sequences if they are required.

var string = "#<SNMP::SNMPv1_Trap:0x278a2258 @enterprise=[1.3.6.1.4.1.9.9.41.2], @timestamp=#<SNMP::TimeTicks:0x16c779e6 @value=1877211447>, @varbind_list=[#<SNMP::VarBind:0x30066c8e @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.2.0], @value="ROUTING-MSDP">, #<SNMP::VarBind:0x46681034 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.3.0], @value=#<SNMP::Integer:0x6b4d4956 @value=6>>, #<SNMP::VarBind:0x7fda94e8 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.4.0], @value="INIT_STDBY_PEER_UP_DOWN">, #<SNMP::VarBind:0x7cbbe581 @name=[1.3.6.1.4.1.9.9.41.1.2.3.1.5.0], @value="down: : received socket disconnect notification ">, #<SNMP::VarBind:0x7ad4b392 @name=[1.3.6.1.4.1.9.9.41.1.2.31.6.0], @value=#<SNMP::TimeTicks:0x7b525267 @value=1877211368>>],  , @agent_addr=#<SNMP::IpAddress:0x5084f431 @value="\xD3O0\x83">, @generic_trap=6>";

Then in php you can echo the string:

<?php echo string; ?>

This will make it simple.

gsthina
  • 1,090
  • 8
  • 22