Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
T
tips
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ARTS2 - Arts Numériques
cultureWeb
tips
Commits
7f0157be
Commit
7f0157be
authored
Nov 20, 2019
by
Étienne Oz
🖖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
php
parent
acd658df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
0 deletions
+100
-0
content/php.md
content/php.md
+100
-0
No files found.
content/php.md
0 → 100644
View file @
7f0157be
## Php
-
### Run php without apache
In your shell:
```
bash
php
-S
localhost:8000
```
if you want start at a different root:
```
bash
php
-S
localhost:8000
-t
</path/to/root>
```
-
### Regex for type (french)
```
php
function
rft
(
$content
)
{
$thinsp
=
'<span class="thinsp"> </span>'
;
$regex
=
array
(
"/ ;/"
=>
';'
,
"/« /"
=>
'«'
,
"/“ /"
=>
'«'
,
"/ »/"
=>
'»'
,
"/ ”/"
=>
'»'
,
"/ :/"
=>
':'
,
"/ !/"
=>
'!'
,
"/ €/"
=>
'€'
,
"/ $/"
=>
'$'
,
"/ £/"
=>
'£'
,
"/ \?/"
=>
'?'
,
"/:/"
=>
$thinsp
.
':'
,
"/«/"
=>
'«'
.
$thinsp
,
"/“/"
=>
'«'
.
$thinsp
,
"/»/"
=>
$thinsp
.
'»'
,
"/€/"
=>
$thinsp
.
'€'
,
"/$/"
=>
$thinsp
.
'$'
,
"/£/"
=>
$thinsp
.
'£'
,
"/”/"
=>
$thinsp
.
'»'
,
"/!/"
=>
$thinsp
.
'!'
,
"/\?/"
=>
$thinsp
.
'?'
,
"/& /"
=>
'& '
,
"/oe/"
=>
'œ'
,
"/ae/"
=>
'æ'
,
"/OE/"
=>
'Œ'
,
"/AE/"
=>
'Æ'
,
"/\.\.\./"
=>
'…'
,
# url bug correction
'/http<span class="thinsp"> <\/span>:/'
=>
'http:'
,
'/https<span class="thinsp"> <\/span>:/'
=>
'https:'
,
'/href="mailto<span class="thinsp"> <\/span>:/'
=>
'href="mailto:'
,
'/watch<span class="thinsp"> <\/span>?/'
=>
'watch'
,
});
foreach
(
$regex
as
$input
=>
$output
)
{
$content
=
preg_replace
(
$input
,
$output
,
$content
);
}
return
$content
;
}
```
Then use the css property
`letter-spacing`
on
`.thinsp`
to set the width value of your thinspace.
-
### Regex for type (english)
```
php
function
rft
(
$content
)
{
$thinsp
=
'<span class="thinsp"> </span>'
;
$regex
=
array
(
"/ ;/"
=>
';'
,
"/« /"
=>
'«'
,
"/“ /"
=>
'“'
,
"/ »/"
=>
'»'
,
"/ ”/"
=>
'”'
,
"/ :/"
=>
':'
,
"/ !/"
=>
'!'
,
"/ €/"
=>
'€'
,
"/ $/"
=>
'$'
,
"/ £/"
=>
'£'
,
"/ \?/"
=>
'?'
,
"/«/"
=>
'«'
.
$thinsp
,
"/»/"
=>
$thinsp
.
'»'
,
"/€/"
=>
$thinsp
.
'€'
,
"/$/"
=>
$thinsp
.
'$'
,
"/£/"
=>
$thinsp
.
'£'
,
"/& /"
=>
'& '
,
"/oe/"
=>
'œ'
,
"/ae/"
=>
'æ'
,
"/OE/"
=>
'Œ'
,
"/AE/"
=>
'Æ'
,
"/\.\.\./"
=>
'…'
,
# url bug correction
'/http<span class="thinsp"> <\/span>:/'
=>
'http:'
,
'/https<span class="thinsp"> <\/span>:/'
=>
'https:'
,
'/href="<main></main>ilto<span class="thinsp"> <\/span>:/'
=>
'href="mailto:'
,
'/watch<span class="thinsp"> <\/span>?/'
=>
'watch'
,
});
foreach
(
$regex
as
$input
=>
$output
)
{
$content
=
preg_replace
(
$input
,
$output
,
$content
);
}
return
$content
;
}
```
Then use the css property
`letter-spacing`
on
`.thinsp`
to set the width value of your thinspace.
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