<?php
$string = "k1/k2/k3";
$keys = explode('/', $string);
$arr = [];
$current = &$arr;
foreach ($keys as $key) {
$current = &$current[$key];
}
$current = "last nested item";
var_dump($arr);
/*
array(1) {
["k1"]=>
array(1) {
["k2"]=>
array(1) {
["k3"]=>
&string(16) "last nested item"
}
}
}
*/
<\s*([a-zA-Z0-9]+)([^>]*[^\/])>
на пустую строку (регулярку не проверял).RUN composer i
, а в ENTRYPOINT'е имеет запуск демона php-fpm... # Helper functions for building the class
$script:nativeMethods = @();
function Register-NativeMethod([string]$dll, [string]$methodSignature)
{
$script:nativeMethods += [PSCustomObject]@{ Dll = $dll; Signature = $methodSignature; }
}
function Add-NativeMethods()
{
$nativeMethodsCode = $script:nativeMethods | % { "
[DllImport(`"$($_.Dll)`")]
public static extern $($_.Signature);
" }
Add-Type @"
using System;
using System.Runtime.InteropServices;
public static class NativeMethods {
$nativeMethodsCode
}
"@
}
Register-NativeMethod "user32.dll" "bool SetWindowText(IntPtr hWnd, string lpString)"
Add-NativeMethods
$myprocess = start-process Notepad -Passthru
# If you change the title immediately nothing will happen because the process isn't done loading.
sleep 1
[NativeMethods]::SetWindowText($myprocess.MainWindowHandle, "something")
document.querySelector('.layers__container').style.transform = `rotateX(${moveY})`
document.querySelector('.layers__container').style.transform = `rotateY(${moveX})`
questionsDat.sort(() => .5 - Math.random())
// click on button every 30s
setTimeout(() => {
document.querySelector("Селектор твоей кнопки").click();
}, 30 * 1000);
const LIMIT = 10;
const getProducts = async (offset, limit) => { ... }
function App () {
const [offset, setOffset] = useState(0);
const [products, setProducts] = useState([])
useEffect(() => {
getProducts(offset, LIMIT).then(products => setProducts(v => [...v, ...products]))
}, [offset]);
return <RenderProducts onScroll={() => { // increment offset }} />
}
// store.ts
const LIMIT = 30;
export const $products = map({
offset: 0,
products: [],
isLoading: true
})
onMount($products, () => {
fetchProducts()
})
const fetchProducts = action($products, "fetchProducts", async store => {
const { products, offset } = store.get();
// TODO: add error handling
store.setKey("isLoading", true);
const newPartOfProducts = await api.getProducts(offset, LIMIT);
store.setKey("products", [...products, ...newPartOfProducts ]);
store.setKey("isLoading", false);
});
const incrementOffset = action($products, "incrementOffset", store => {
const { offset } = store.get();
store.setKey("offset", offset + LIMIT);
fetchProducts()
})
export const $productsMutations = { incrementOffset }
// App.tsx
function App () {
const { isLoading, products } = useStore($products)
return (
<Fragment>
<RenderProducts onScroll={$productsMutations.incrementOffset} products={products} />
{isLoading && <LoadingIndicator />}
</Fragment>
)
}