injquery展开和折叠+php


injquery expand and collapse + php

嗨,我正在执行mysql查询,并得到以下结果

Array
(
    [0] => 131.208.0.0
    [1] => 141.128.0.0
    [2] => 141.129.0.0
    [3] => 155.182.0.0
    [4] => 155.183.0.0
 )

使用jquery展开,我需要打印如下所示。如果我点击+,它应该展开并显示以下值。我在UI+131、+141和+151中显示唯一值。我需要将这些值传递给php,并在单击时获得结果。

 -131.0.0.0
  -131.208.0.0
-141.0.0.0
  -141.1298.0.0
  -141.129.0.0
+155.182.0.0

我的代码

$(document).ready(function(){
    //hide the all of the element with class msg_body
    $(".msg_body").hide();
    //toggle the componenet with class msg_body
    $(".msg_head").click(function(){
        $(this).next(".msg_body").slideToggle(600);
<div class="msg_body">
        <?php 
            $octets = $this->Ip;
            foreach($octets as $octet){
                //echo "+".$octet."<br />";
            }
            // Here display unique octet value.
            $octetets = $this->octent1;
            foreach($octetets as $octet){
                echo "+".$octet."<br />";
            }

        ?>
        </div>

您的代码确实可以进行一些小的更改。。。请参阅演示。