如何在阵列的多个索引上拆分数组数据 [英] How can I split the array data on multiple indexes of the array

查看:76
本文介绍了如何在阵列的多个索引上拆分数组数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://www.timenspacemedia.com/carP/

put the copy the vehicle number and paste it into the text box and submit it... it will show all the data on 1 array index... we need all the attributes in the different indexes of the array like this

array[0]= car registartion number
array[1] = Engine Number







<?php
error_reporting(0);
if (isset($_POST['dname'])) {
$dname = $_POST['dname'];
$url='http://mtmis.punjab.gov.pk/Tax%20Collection/searchNameTemp.jsp?names='.$dname;
 $homepage = file_get_contents($url);
$dom = new DomDocument();
$dom->loadHTML($homepage);
$xpath = new DOMXpath($dom);
$mystring="";
$elements = $xpath->query(".//*[@id='Table_01']");   
 if (!is_null($elements)) {  
        $resultarray=array();
        foreach ($elements as $element) 
		{
            $nodes = $element->childNodes;
            foreach ($nodes as $node) 
			{
              $resultarray[] = $node->nodeValue;
			  $mystring .= $node->nodeValue;
            }
        }
    }



print_r($resultarray);
}
else {
header('Location: http://www.timenspacemedia.com/carP/');
}
?>

推荐答案

_POST [' dname'])){
_POST['dname'])) {


dname =
dname =


_POST [' dname'];
_POST['dname'];


这篇关于如何在阵列的多个索引上拆分数组数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆