Jump to content

Search the Community

Showing results for tags 'xquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I am trying to retrieve a really tricky array of values. The value I am trying to retrieve are the -price values and the text within the price tag -color values which can be more than one option (black and white in this case) <dd> <div class="input-box"> <select name="options[1216]" id="select_1216" class="product-custom-option" title="" onchange="opConfig.reloadPrice()"> <option value="" >-- Please Select --</option> <option value="4185" price="4.99" >4GB +$4.99</option> <option value="4186" price="5.99" >8GB +$5.99</option> <option value="4187" price="9.99" >16GB +$9.99</option> <option value="4188" price="16.99" >32GB +$16.99</option> <option value="4189" price="29.99" >64GB +$29.99</option> </select> </div> </dd> <dt> <label class="required"><em>*</em>Color</label></dt> <dd class="last"> <div class="input-box"> <ul id="options-1215-list" class="options-list"> <li><input type="radio" class="radio validate-one-required-by-name product-custom-option" onclick="opConfig.reloadPrice()" name="options[1215]" id="options_1215_2" value="4183" price="0" /> <span class="label"><label for="options_1215_2">Black </label></span> <script type="text/javascript"> </li> <li> <input type="radio" class="radio validate-one-required-by-name product-custom-option" onclick="opConfig.reloadPrice()" name="options[1215]" id="options_1215_3" value="4184" price="0" /> <span class="label"><label for="options_1215_3">White </label></span> </li> </ul> </div> I have wrtten the following code to try and retrieve the values of the price but to no avail. I'm trying to use a wildcard character in the xquery to try because other pages will have different option names. Here is what I came up with so far. There won't be more than 20 options on a page. Any help would be much appreciated. Thanks in advance. $option_array = array(); for($k = 1; $k <= 20; $k++) { $option_array[$k] = $xpath->query("//div[@class='input-box']//select/*/option[$k]/@price")->item(0)->textContent; //If we have captured all the images then we need to exit the for loop if($option_array[$k] == null){ break; } }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.