Table of Contents
回复讨论(解决方案)
Home Backend Development PHP Tutorial 求数组中的对应关系

求数组中的对应关系

Jun 23, 2016 pm 02:18 PM

本帖最后由 lazygc520 于 2013-07-03 12:12:16 编辑

数组1:Array(    [0] => Array        (            [cust_no] => 237033AW0A            [lotno] => 3207            [lotno_count] => 360        ))数组2:Array([SU13061301033] => Array        (            [0] => Array                (                    [0] => 2013-06-19 09:00:00                    [1] => X02B                    [2] => 237033AW0A                    [3] => 15                    [4] => 14                    [5] => 210                )        )[SU13061301032] => Array        (            [0] => Array                (                    [0] => 2013-06-19 09:00:00                    [1] => X02B                    [2] => 237033AW0A                    [3] => 15                    [4] => 17                    [5] => 255                )        )[SU13061301037] => Array        (            [0] => Array                (                    [0] => 2013-06-19 09:00:00                    [1] => X11Q                    [2] => 237033AW0A                    [3] => 15                    [4] => 3                    [5] => 45                )            [1] => Array                (                    [0] => 2013-06-19 09:00:00                    [1] => X11Q                    [2] => 237033AW0A                    [3] => 15                    [4] => 2                    [5] => 30                )        ))数组3:Array(              [0] => SU13061301033              [1] => SU13061301032              [2] => SU13061301037 )
Copy after login

数组1 代表 取得的总数量。
数组2 代表 stockno(SU开头部分)时对应的数量,值为第[5]项。
数组3 代表 stockno 在数组中的序列。

能不能根据数组3的序列求得,
stockno为SU13061301033时,对应数组1中的前210项对应stockno为SU13061301033 ,
stockno为SU13061301032时,对应数组1中的剩余的项对应stockno为SU13061301033 。
依次类推这种情况。

是否存在这种对应关系?


回复讨论(解决方案)

您的 数组1 不就只有一组数据吗?

您的 数组1 不就只有一组数据吗?
这样就无法匹配是吗?数组1和数组3只有对应关系才能求得结果。

如果实在找不到对应关系的话就无法求得需要的值?

对应数组1中的 前210项 这个怎么说?

对应数组1中的 前210项 这个怎么说?
我的意思是数组3中的stockno排在前面的,比如第一项SU13061301033,对应数组2中的值是210。然后用数组1中的总数量去分配210这个值,后面的stockno用总数量-210的结果再去分配下一组值。
PS:可能结果出了问题,所以我要重新查看下sql语句。稍晚再回复您。

如果用排队,倒是可以的
但关键还是在于你数据间的依赖性

如果用排队,倒是可以的
但关键还是在于你数据间的依赖性
好的。明天麻烦你指导下。

还需要你理清思绪路
贴数据时,请帖 var_export 的结果,而不是 print_r 的结果
与人方便,与己方便

结果存储的问题吧

还需要你理清思绪路
贴数据时,请帖 var_export 的结果,而不是 print_r 的结果
与人方便,与己方便

有三张表:kw_manage,vp_barcode_2d_y,stock_detail,分别对应库存,库存对应的批次lotno,出库信息。

库存以packageno为单位入库,通过vp_barcode_2d_y这张表求得入库的packageno对应的批次lotno及数量,cust_no,出库stock_detail含有信息stock_no,对应的关系:一个stock_no对应多个cust_no和对应的数量。
例如下:

SU13061301012(stock_no) 	A2 	2013-06-19 09:00:00 	B12D(3) 	K25B460 	237033AW0A(cust_no) 	10 	15 	2013-06-15 15:00:00 	2013-06-15 15:30:00SU13061301012(stock_no)  	A2 	2013-06-19 09:00:00 	B12D(3) 	K25B459 	237033AW0A(cust_no)	10 	15 	2013-06-15 15:00:00 	2013-06-15 15:30:00
Copy after login

PS:图中数量为10*15 (箱数*每箱的个数)
也就是说stock_no和packageno之间没有必然联系,是否可以通过按批次lotno的先入先出来处理对应关系?
或者说你需要哪部分var_export的结果?

或略具体品种,即一下的讨论值针对单一的品种
入库时有 入库批次和数量 两个属性
出库时有 出库批次和数量 两个属性

你似乎是需要统计:在某个出库批次中都是由哪些入库批次构成的

我理解的对吗?

或略具体品种,即一下的讨论值针对单一的品种
入库时有 入库批次和数量 两个属性
出库时有 出库批次和数量 两个属性

你似乎是需要统计:在某个出库批次中都是由哪些入库批次构成的

我理解的对吗?
是这样。理解正确。

通常情况,我是先正常入库,再根据出库的要求(stock_detail表)用入库的信息来匹配要求。

入库:

CREATE TABLE `kw_manage` (  `ID` int(11) NOT NULL auto_increment,  `username` varchar(10) NOT NULL,  `rkno` varchar(25) NOT NULL,  `packageno` varchar(20) NOT NULL,  `type` varchar(20) NOT NULL,  `cust_no` varchar(20) NOT NULL,  `snp` int(4) NOT NULL,  `wh_info` varchar(20) NOT NULL,  `date` datetime NOT NULL,  PRIMARY KEY  (`ID`),  KEY `packageno` (`packageno`),  KEY `date` (`date`)) ENGINE=MyISAM;INSERT INTO `kw_manage` VALUES (1, 'admin', '201302190001', 'VP3.0 130219001', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-27 10:56:10');INSERT INTO `kw_manage` VALUES (2, 'admin', '201302190001', 'VP3.0 130219002', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-27 10:56:12');INSERT INTO `kw_manage` VALUES (3, 'admin', '201302190001', 'VP3.0 130219003', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-27 10:56:14');INSERT INTO `kw_manage` VALUES (4, 'admin', '201302190001', 'VP3.0 130219004', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:20');INSERT INTO `kw_manage` VALUES (5, 'admin', '201302190001', 'VP3.0 130219005', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:23');INSERT INTO `kw_manage` VALUES (6, 'admin', '201302190001', 'VP3.0 130219006', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:26');INSERT INTO `kw_manage` VALUES (7, 'admin', '201302190001', 'VP3.0 130219007', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:28');INSERT INTO `kw_manage` VALUES (8, 'admin', '201302190001', 'VP3.0 130219008', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:30');INSERT INTO `kw_manage` VALUES (9, 'admin', '201302190001', 'VP3.0 130219009', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:32');INSERT INTO `kw_manage` VALUES (10, 'admin', '201302190001', 'VP3.0 130219010', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:35');INSERT INTO `kw_manage` VALUES (11, 'admin', '201302190001', 'VP3.0 130219011', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:38');INSERT INTO `kw_manage` VALUES (12, 'admin', '201302190001', 'VP3.0 130219012', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:45:42');INSERT INTO `kw_manage` VALUES (13, 'admin', '201302190002', 'VP3.0 130219013', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:06');INSERT INTO `kw_manage` VALUES (14, 'admin', '201302190002', 'VP3.0 130219014', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:09');INSERT INTO `kw_manage` VALUES (15, 'admin', '201302190002', 'VP3.0 130219015', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:11');INSERT INTO `kw_manage` VALUES (16, 'admin', '201302190002', 'VP3.0 130219016', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:13');INSERT INTO `kw_manage` VALUES (17, 'admin', '201302190002', 'VP3.0 130219017', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:15');INSERT INTO `kw_manage` VALUES (18, 'admin', '201302190002', 'VP3.0 130219018', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:18');INSERT INTO `kw_manage` VALUES (19, 'admin', '201302190002', 'VP3.0 130219019', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:19');INSERT INTO `kw_manage` VALUES (20, 'admin', '201302190002', 'VP3.0 130219020', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:22');INSERT INTO `kw_manage` VALUES (21, 'admin', '201302190002', 'VP3.0 130219021', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:27');INSERT INTO `kw_manage` VALUES (22, 'admin', '201302190002', 'VP3.0 130219022', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:30');INSERT INTO `kw_manage` VALUES (23, 'admin', '201302190002', 'VP3.0 130219023', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:33');INSERT INTO `kw_manage` VALUES (24, 'admin', '201302190002', 'VP3.0 130219024', 'BEM330-500', '23703 3AW0A', 15, 'YE-00-01', '2013-06-28 08:46:36');INSERT INTO `kw_manage` VALUES (25, 'admin', '201302190023', 'VP3.0 130219048', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:16:57');INSERT INTO `kw_manage` VALUES (26, 'admin', '201302190023', 'VP3.0 130219049', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:01');INSERT INTO `kw_manage` VALUES (27, 'admin', '201302190023', 'VP3.0 130219050', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:08');INSERT INTO `kw_manage` VALUES (28, 'admin', '201302190023', 'VP3.0 130219051', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:13');INSERT INTO `kw_manage` VALUES (29, 'admin', '201302190023', 'VP3.0 130219052', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:23');INSERT INTO `kw_manage` VALUES (30, 'admin', '201302190023', 'VP3.0 130219053', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:30');INSERT INTO `kw_manage` VALUES (31, 'admin', '201302190023', 'VP3.0 130219054', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:39');INSERT INTO `kw_manage` VALUES (32, 'admin', '201302190023', 'VP3.0 130219055', 'MEC718-000', '23710 JE22A', 15, 'YQ-00-01', '2013-07-08 11:17:54');
Copy after login

本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去

本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去
出库:

$sql4 = "select arr_time,c_type,cust_no,snp,mount,mount*snp as m_total,stock_no from `".$t."` where stock_no = '".$stockno[$j-1]."'";//	echo $sql4.'<br />';	$result4 = mysql_query($sql4);	$ar = array();	while($var = mysql_fetch_array($result4,MYSQL_NUM))	{		$ar[] = $var;	}	$a = array();	foreach ($ar as $item) {    $key = array_pop($item);    if (! isset($a[$key])) $a[$key] = array();    $a[$key][] = $item;}var_xeport的结果:array ( 'SU13061301033' => array ( 0 => array ( 0 => '2013-06-19 09:00:00', 1 => 'X02B', 2 => '237033AW0A', 3 => '15', 4 => '14', 5 => '210', ), ), )
Copy after login


入库:
$sql = "select DISTINCT b.packageno,a.stock_no from `stock_detail` as a,`kw_manage` as b where a.stock_no = '".$stockno[$j-1]."' and a.cust_no = replace( b.cust_no, ' ', '' )";//	echo $sql.'<br />';	$result = mysql_query($sql);	$res = array(); //设置一个用于存放结果的数组	while($row = mysql_fetch_array($result,MYSQL_ASSOC))	{		$sql2 = "select lotno,count(lotno) from `vp_barcode_2d_y` where packageno = '".$row['packageno']."' group by lotno,packageno order by lotno asc";//		echo $sql2.'<br />';		$result2 = mysql_query($sql2);		$var = array();		while($row2 = mysql_fetch_array($result2,MYSQL_NUM))		{			if(isset($res[$row2[0]])) 			$res[$row2[0]]['count'] += $row2[1];			else 			$res[$row2[0]] = array('lotno'=>$row2[0],'count'=>$row2[1]);		}	}	ksort($res);//	print_r($res);	$arrs = array();	foreach($res as $v2)	{		$arrs[] = $v2;	}	var_export($arrs);结果:array ( 0 => array ( 'lotno' => '3207', 'count' => 360, ), )//这个结果是入库的总数量,是否要求得分别的数量? 
Copy after login

你贴 入库 的代码是什么意思?

你贴 入库 的代码是什么意思?
不需要知道入库总量?如何去判定入库的批次已匹配过,不回出现在其他的stock_no的结果中?

你给的数据和代码不配套
Unknown column 'arr_time' in 'field list'

刚才出库的数据没给全,贴不下了。现在补上。

CREATE TABLE `stock_detail` (  `ID` int(11) NOT NULL auto_increment,`stock_no` varchar(20) NOT NULL,`adress` varchar(10) NOT NULL,`arr_time` datetime NOT NULL,`c_type` varchar(20) NOT NULL,`pu_no` varchar(20) NOT NULL,`cust_no` varchar(20) NOT NULL,`mount` int(10) NOT NULL,`snp` int(10) NOT NULL,`c1_time` datetime NOT NULL,`c2_time` datetime NOT NULL, PRIMARY KEY  (`ID`)) ENGINE=MyISAM;INSERT INTO `stock_detail` VALUES (42, 'SU13061301029', 'B', '2013-06-20 22:00:00', 'P32L', 'K25K498', '310F61VA5A', 9, 16, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (43, 'SU13061301029', 'B', '2013-06-20 22:00:00', 'P32L', 'K25K497', '310F61VA5A', 10, 16, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (44, 'SU13061301031', 'A1', '2013-06-20 09:00:00', 'X02B', 'K25B418', '237033AW0A', 14, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (45, 'SU13061301030', 'A1', '2013-06-20 09:00:00', 'X02B', 'K25B417', '237033AW0A', 17, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (46, 'SU13061301033', 'A1', '2013-06-19 09:00:00', 'X02B', 'K25B416', '237033AW0A', 14, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (47, 'SU13061301032', 'A1', '2013-06-19 09:00:00', 'X02B', 'K25B415', '237033AW0A', 17, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (48, 'SU13061301034', 'A1', '2013-06-19 09:00:00', 'X11Q', 'K25B407', '237033AW0A', 6, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (49, 'SU13061301034', 'A1', '2013-06-19 09:00:00', 'X11Q', 'K25B408', '237033AW0A', 9, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (50, 'SU13061301035', 'A1', '2013-06-20 09:00:00', 'X11Q', 'K25B409', '237033AW0A', 7, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (51, 'SU13061301035', 'A1', '2013-06-20 09:00:00', 'X11Q', 'K25B410', '237033AW0A', 9, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (52, 'SU13061301036', 'A1', '2013-06-20 09:00:00', 'X11Q', 'K25B434', '237033AW0A', 3, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (53, 'SU13061301036', 'A1', '2013-06-20 09:00:00', 'X11Q', 'K25B433', '237033AW0A', 2, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (54, 'SU13061301037', 'A1', '2013-06-19 09:00:00', 'X11Q', 'K25B431', '237033AW0A', 3, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (55, 'SU13061301037', 'A1', '2013-06-19 09:00:00', 'X11Q', 'K25B432', '237033AW0A', 2, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (56, 'SU13061500001', 'A1', '2013-06-20 09:00:00', 'L11K', 'C6E0085', '23703EX80A', 2, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');INSERT INTO `stock_detail` VALUES (57, 'SU13061500002', 'A1', '2013-06-20 09:00:00', 'X11Q', 'C6E0084', '237033AW0A', 1, 15, '2013-06-15 15:00:00', '2013-06-15 15:30:00');
Copy after login

你给的数据和代码不配套
Unknown column 'arr_time' in 'field list'
烦见20#

本着先进先出的原则,出库过程是这样的:
出库数量已知
遍历入库表,从 出库数量 中扣除当前入库批次的数量,直到 出库数量 小于等于 0
若 出库数量 为负,则将其绝对值加回去

烦请举个例子吧,对这句话的意思不理解。
遍历入库表,从 出库数量 中扣除当前入库批次的数量

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

The Enduring Relevance of PHP: Is It Still Alive? The Enduring Relevance of PHP: Is It Still Alive? Apr 14, 2025 am 12:12 AM

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

How does PHP type hinting work, including scalar types, return types, union types, and nullable types? How does PHP type hinting work, including scalar types, return types, union types, and nullable types? Apr 17, 2025 am 12:25 AM

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values ​​and handle functions that may return null values.

PHP and Python: Code Examples and Comparison PHP and Python: Code Examples and Comparison Apr 15, 2025 am 12:07 AM

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP vs. Other Languages: A Comparison PHP vs. Other Languages: A Comparison Apr 13, 2025 am 12:19 AM

PHP is suitable for web development, especially in rapid development and processing dynamic content, but is not good at data science and enterprise-level applications. Compared with Python, PHP has more advantages in web development, but is not as good as Python in the field of data science; compared with Java, PHP performs worse in enterprise-level applications, but is more flexible in web development; compared with JavaScript, PHP is more concise in back-end development, but is not as good as JavaScript in front-end development.

See all articles