小编Aki*_*isC的帖子

php数组选择大于数字且低于另一数字的值并将其保存到新数组

我有一个包含以下数字的数组(动态创建)

$numbers = array (200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 12000, 14000, 15000, 16000, 18000, 20000, 21000, 24000, 25000, 27000, 30000, 35000, 40000, 45000, 50000, 60000, 70000, 75000, 80000, 90000, 100000, 105000, 120000, 135000, 140000, 150000, 160000, 180000, 200000, 250000, 300000, 350000, 400000, 450000, 500000, 600000, 700000, 800000, 900000, 1000000)
Run Code Online (Sandbox Code Playgroud)

我想通过> =和<=创建新数组(已过滤),例如新数组包含的数字大于或等于(> =)大于800且小于或等于(<=)大于1600

New Array
(
    [0] => 800
    [1] => 1000
    [2] => 1200
    [3] => 1400 …
Run Code Online (Sandbox Code Playgroud)

php arrays

9
推荐指数
2
解决办法
2万
查看次数

delphi到C++构建器的转换

我在Delphi中有源代码我按照http://hscripts.com/tutorials/cpp/bitwise-operators.php为按位运算符在C++ Builder中转换它,但结果是不同的

Delphi中的源代码

procedure TForm1.Button1Click(Sender: TObject)
var
    tmp, dynamicINT : integer;
begin
    dynamicINT := 42080;
    tmp := ((dynamicINT shl 1) or (dynamicINT shr 31) and $7FFFFFFF);

    Edit1.Text := IntToHex(tmp, 4);
end;
Run Code Online (Sandbox Code Playgroud)

德尔福结果:148C0正确!

C++ Builder中的源代码

void __fasctall TForm1::Button1Click(TObject *Sender)
{
    int tmp = 0;
    int dynamicINT = 42080;

    tmp = ((dynamicINT << 1) || (dynamicINT >> 31) && 0x7FFFFFFF);
    Edit1->Text = IntToHex(tmp, 4);
}
Run Code Online (Sandbox Code Playgroud)

C++ Builder结果:0001???

转换有什么问题?

我正在使用C++ Builder 6和Delphi 7

delphi c++builder binary-operators boolean-operations

3
推荐指数
1
解决办法
1131
查看次数

php数组获取特定值的位置

我有一个数组,我想得到一个特定值的位置

例:

$my_array = array(0,2,5,3,7,4,5,2,1,6,9);
Run Code Online (Sandbox Code Playgroud)

我的搜索是5 阵列中5 的位置是(26)

如果我调用array_search函数,总是返回在数组女巫第一位置是2.

反正有没有获得两个具有特定价值的矿石?

php arrays position

2
推荐指数
1
解决办法
5797
查看次数

PHP类 - 致命错误:调用未定义的方法

test.php的

class AClass {
    public function __construct()
    {
        echo '<strong style="color:blue;">AClass construct</strong><br>';
    }

    public function call()
    {
        $this->koko();
    }

    private function koko()
    {
        echo 'koko <br>';
    }
}

class BClass extends AClass {

    public function __construct()
    {
        echo '<strong style="color:red;">BClass construct</strong><br>';
        parent::__construct();
    }

    public function momo()
    {
        echo 'momo <br>';
    }
}


$xxx = new AClass(); // Output: AClass contruct ..... (where is BClass echo ?)
$xxx->call(); // Output: koko
$xxx->momo(); // Output: Fatal error: Call to undefined method AClass:momo() …
Run Code Online (Sandbox Code Playgroud)

php class

0
推荐指数
1
解决办法
2万
查看次数

空文本按钮的CSS位置

我有一个风格的三个简单的HTML按钮height- min-width-和border。一个带文本,第二个带非制动空间,最后一个带空文本。

我的问题是在浏览器视图上,带有空文本的最后一个按钮在不同的位置打印。

CSS:

.test {
    height: 27px;
    border: 1px solid #b4b1ff;
    min-width: 54px;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<button class="test">Text</button>      <!-- with text -->
<button class="test">&nbsp;</button>    <!-- with Non Breaking Space -->
<button class="test"></button>          <!-- Empty ?? -->
Run Code Online (Sandbox Code Playgroud)

小提琴

css html5

0
推荐指数
1
解决办法
1418
查看次数