小编Moh*_*mer的帖子

从php数组中只过滤重复的url

这是阵列

Array ( 
   [EM Debt] => http://globalevolution.gws.fcnws.com/fs_Overview.html?isin=LU0616502026&culture=en-GB 
   [EM Local Debt] => Will be launched shortly 
   [EM Blended Debt] => Will be launched shortly 
   [Frontier Markets] => http://globalevolution.gws.fcnws.com/fs_Overview.html?isin=LU0501220262 
   [Absolute Return Debt and FX] => Will be launched shortly 
   [Em Debt] => http://globalevolution.gws.fcnws.com/fs_Overview.html?isin=LU0501220262 
) 
Run Code Online (Sandbox Code Playgroud)

如果我使用array_unique()它也会Will be launched shortly从数组中过滤掉.

我只想过滤重复的网址,而不是文字.

更新:

我需要将Array顺序保持不变,只需过滤dupl即可

php arrays url filtering duplicates

10
推荐指数
3
解决办法
355
查看次数

使用jQuery从类中获取soundManager soundId

我正在使用soundmanager的bar-ui js.

<div id="sm2-99943" class="sm2-bar-ui content compact flat full-width playlist full-width-player ">
    <div class="bd sm2-main-controls">
        <div class="sm2-inline-element sm2-button-element">
            <div class="sm2-button-bd" style="background: transparent url(http://support.simplepodcaster.com/wp-content/uploads/2018/04/podcast_channel_artwork-150x150.png) repeat scroll 0% 0% / cover ;">
                <div id="spp-player-background"> </div>
                <a href="#play" class="sm2-inline-button play-pause">Play / pause</a>
                <div class="eq">
                    <span class="bar bar-1"></span>
                    <span class="bar bar-2"></span>
                    <span class="bar bar-3"></span>
                    <span class="bar bar-4"></span>
                </div>
            </div>
        </div>
        <div class="sm2-inline-element sm2-inline-status progressbar" style="padding-right:0px !important;">
            <div class="sm2-playlist">
                <div class="sm2-playlist-target" style="max-width: 100% !important;"></div>
            </div>
            <div class="sm2-progress">
                <div class="sm2-progress-bd">
                    <div class="sm2-progress-track">
                        <div class="sm2-progress-bar1" style="display:none;"></div>
                        <div …
Run Code Online (Sandbox Code Playgroud)

javascript jquery soundmanager2

7
推荐指数
1
解决办法
194
查看次数

想了解SounManager播放器ID

我正在使用soundmanager的bar-ui js.

http://www.schillmania.com/projects/soundmanager2/demo/bar-ui/
Run Code Online (Sandbox Code Playgroud)

我有很多玩家所以我不知道在页面加载播放器加载时我想要的是什么.

http://support.simplepodcaster.com/auto-timestamps/
Run Code Online (Sandbox Code Playgroud)

看我在我的页面上有三个玩家我想要....

我试过了

var mySoundObject = soundManager.createSound({
id: 'mySound',
url: '/audio/mysoundfile.mp3',
// optional sound parameters here, see Sound Properties for full list
volume: 50,
autoPlay: true,
whileloading: function() {
        jQuery(".playercontent").data('sound-id', this.id);
}
});
Run Code Online (Sandbox Code Playgroud)

但问题是我可以获得声音,直到我玩,否则我无法得到身份证.

页面加载时有没有办法获取id?

javascript jquery soundmanager2

5
推荐指数
1
解决办法
114
查看次数

将带有值的产品属性添加到 Woocommerce 中的产品

我正在使用此代码添加自定义属性

$attributes = array(
    array("name"=>"Size","options"=>array("S","L","XL","XXL"),"position"=>1,"visible"=>1,"variation"=>1),
    array("name"=>"Color","options"=>array("Red","Blue","Black","White"),"position"=>2,"visible"=>1,"variation"=>1)
);
if($attributes){
    $productAttributes=array();
    foreach($attributes as $attribute){
        $attr = wc_sanitize_taxonomy_name(stripslashes($attribute["name"])); // remove any unwanted chars and return the valid string for taxonomy name
        $attr = 'pa_'.$attr; // woocommerce prepend pa_ to each attribute name
        if($attribute["options"]){
            foreach($attribute["options"] as $option){
                wp_set_object_terms($product_id,$option,$attr,true); // save the possible option value for the attribute which will be used for variation later
            }
        }
        $productAttributes[sanitize_title($attr)] = array(
            'name' => sanitize_title($attr),
            'value' => $attribute["options"],
            'position' => $attribute["position"],
            'is_visible' => $attribute["visible"],
            'is_variation' => $attribute["variation"], …
Run Code Online (Sandbox Code Playgroud)

php wordpress custom-taxonomy woocommerce taxonomy-terms

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