Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1b9e07f6
authored
Nov 09, 2022
by
SUDPTDUBLXEROFX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
digikey
parent
8a10ec30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
.idea/workspace.xml
app/helpers.php
.idea/workspace.xml
deleted
100644 → 0
View file @
8a10ec30
This diff is collapsed.
Click to expand it.
app/helpers.php
View file @
1b9e07f6
...
...
@@ -22,3 +22,42 @@ if (!function_exists('generate_letters')) {
return
$letters
;
}
}
/*
* 反爬虫用html标签替换数字,不包括“.”
* $number 数字串
*/
function
numberToHtml
(
$number
){
$arr
=
[
[
'asfgdqwer'
,
'asfgdtyhg'
,
'asfgdpolk'
,
'asfgdpoqw'
],
[
'asfgdrfdf'
,
'asfgderfd'
,
'asfgdwdsa'
,
'asfgdpoer'
],
[
'asfgdasde'
,
'asfgdqwsz'
,
'asfgdrtgd'
,
'asfgdpovv'
],
[
'asfgdwsxc'
,
'asfgdwsxz'
,
'asfgdrfvb'
,
'asfgdpoee'
],
[
'asfgdqazs'
,
'asfgdqasd'
,
'asfgdqwag'
,
'asfgdpogh'
],
[
'asfgdrtyh'
,
'asfgdyutr'
,
'asfgdeews'
,
'asfgdpotg'
],
[
'asfgdpluj'
,
'asfgdikjf'
,
'asfgdesgj'
,
'asfgdpfff'
],
[
'asfgdtrdb'
,
'asfgdiksf'
,
'asfgdsgkp'
,
'asfgdprty'
],
[
'asfgdpehl'
,
'asfgdstgb'
,
'asfgderll'
,
'asfgdpokf'
],
[
'asfgdpehg'
,
'asfgdstgf'
,
'asfgderlf'
,
'asfgdpogk'
]
];
if
(
empty
(
$arr
)){
return
$number
;
}
$len
=
strlen
(
$number
);
if
(
$len
>
0
){
$str
=
''
;
for
(
$i
=
0
;
$i
<
$len
;
$i
++
){
$num
=
substr
(
$number
,
$i
,
1
);
if
(
preg_match
(
'/\d/'
,
$num
)){
$index
=
rand
(
0
,
3
);
$class
=
$arr
[
$num
][
$index
];
$other_class
=
strRandom
(
$class
);
$num
=
'<font class="'
.
$class
.
$other_class
.
'"></font>'
;
}
$str
.=
$num
;
}
return
$str
;
}
else
{
return
$number
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment