mirror of
https://gitlab.com/CodeSolutionsProject/CodeGuide
synced 2026-02-14 00:51:35 +01:00
Initial commit
This commit is contained in:
8
langs/php/basic.json
Normal file
8
langs/php/basic.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"array": "$var = array(1,2,3,'texto');",
|
||||
"variable": [
|
||||
"// It cannot be do",
|
||||
"$a = 5;",
|
||||
"$b = 6;"
|
||||
]
|
||||
}
|
||||
8
langs/php/database.json
Normal file
8
langs/php/database.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"sqlite": {
|
||||
"connect": "$db_conn = new SQLite3('path/to/database.sqlite');",
|
||||
"query": "$query = $db_conn->query(\"Query\");",
|
||||
"fetch_array": "$array = $query->fetchArray();"
|
||||
}
|
||||
|
||||
}
|
||||
16
langs/php/functions/in_array.json
Normal file
16
langs/php/functions/in_array.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"visual": "in_array($search,$array[,type])",
|
||||
"description": "It searches in a Array for a string \n Type is optional and its for searching exact pattern (true) or not (nothing)",
|
||||
"parameters" : {
|
||||
"$search": "What you want to find",
|
||||
"$array": "The array for search",
|
||||
"$type": "Exact pattern or not"
|
||||
},
|
||||
"example": [
|
||||
"$os = array(\"Windows\",\"Linux\",\"Mac\");",
|
||||
"if (in_array(\"Win\",$os)){",
|
||||
" echo \"Encontrado Win en os\";",
|
||||
"}"
|
||||
],
|
||||
"output": "Encontrado Win en os"
|
||||
}
|
||||
27
langs/php/general.md
Normal file
27
langs/php/general.md
Normal file
@@ -0,0 +1,27 @@
|
||||
- Version 0.1 -
|
||||
|
||||
#### General grammar of lang
|
||||
|
||||
- All lines finish with a semicolon (;)
|
||||
|
||||
- Vars are append with a dollar sign ever -> $x is x variable
|
||||
|
||||
- Vars aren't defined before use. Doesn't name Int,String,.... ever
|
||||
|
||||
- When echoing or using functions, you can use 'text' or "text", but in first ones you can't embed a var. Example:
|
||||
|
||||
'Hello $x' -> Hello $x
|
||||
|
||||
"Hello $x" -> Hello World
|
||||
|
||||
#### Comments
|
||||
|
||||
```
|
||||
// This is a single line comment
|
||||
/* This is
|
||||
a multiline comment */
|
||||
```
|
||||
|
||||
#### Types of vars
|
||||
|
||||
Nothing to show here.
|
||||
Reference in New Issue
Block a user