Table of Contents

PHP and SQL

Php Date and Time Related

Python to Php

python php
string operation word.strip() trim($word)
word[1:5] substr($word, 1, 5)
word[1:] substr($word, 1)
prefix+subfix $prefix.$subfix
text.replace('find','replace') str_replace('find','replace',$text)
text.lower() strtolower($text)
text.startswith(prefix) ?
list operation res_list = [x.strip() for x in txt.split('\n')] $res_list = array_map('trim', explod('\n', $txt))
$res_list = array_map('trim', preg_split("/\r\n|\n|\r/", $selected) ); // ok for text
res_list.append(tmp_img) array_push($res_list, $tmp_img);
$res_list[] = $tmp_img;
for each in word_list: foreach($word_list as $each){}
if id in check_list: if(in_array($id, $check_list)){}
logic if mark == '#': pass; elif mark == '*' if($mark===“#”){} elseif($mark===“*”){}
php: 
$tmp_path = $path.strtolower(str_replace(' ','_', trim(substr($each,1)))).'.jpg';
$tmp_img = sprintf('<br><img src="%s">', $tmp_path);
array_push($res_list, $tmp_img);
join("\n",$res_list);

python: (human logic writing)
tmp_path = path + each[1:].strip().replace(' ','_').lower()+ '.jpg'
tmp_img = '<br><img src="{0}">'.format(tmp_path)
res_list.append(tmp_img)
'\n'.join(res_list)

Use PHP as HTML File output process