If it’s just a simple tweak to the output string then just use str_replace.
$averagePricejson = "[[0,0],[1,39000],[2,62500],[3,80000]]";
$averagePricejson = str_replace( "]]", "],]", $averagePricejson);
echo $averagePricejson; // [[0,0],[1,39000],[2,62500],[3,80000],]
Related Posts:
- Configuring a meta query with multiple post types that have the same relationship on a single page
- Loop increase number
- Foreach loop returning more than one item when querying taxonomy
- set object terms after some some time of published post – functions.php
- How to use a custom post type archive as front page?
- Display a query with multiple post types and same relationship on a single page
- Custom post status not working
- Date archives for custom post type
- How can I add dropdown widget/box to admin post page?
- Custom post type loops with different page templates
- Limit Authors to their Own Posts on front-end excluding admins
- Adding a span when custom post type is updated
- Append taxonomy terms as class names in markup?
- How do you output custom code between posts in the loop?
- Hide a widget inside a div on specific type of post
- Different Category system needed for the Custom Post Type
- Redirect to another page using contact form 7? [closed]
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- categories should be available across all custom post types
- How can I group posts by months and years?
- PHP question: how to combine syntax?
- custom post for slider
- Using wp_query to modify the loop in index.php for a CPT
- WP_Query Custom Post Type if Category ID Equals
- Assign category a default post type
- Is This Code Efficient – Or is there a better way?
- How to use a variable as a function name?
- How exclude or skip post type with get_next_post_link
- Different options per post type in WP_Query
- Show message when query has no posts
- Create short URL with auto 301 redirect
- Undefined $post in wp_query
- Removing full title and breadcrumb header container for a specific post type
- Is it possible to use array_walk() to append terms to an array of posts?
- Get current user id
- Custom post type and custom taxonomy 404 on page 2
- Show current user posts in custom post type query
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- post_content is stripping HTML when adding a new post? [closed]
- List latest post out of 2 custom post types
- Template code to split a post and print a custom field?
- foreach loop inside the loop creating duplicates in output
- Let users upload image(s) to the post from front end
- Function to erase every post from a taxonomy
- Post type Echo code is repeating on homepage
- redirect after submiting post for review
- Page that lists publications by classifying them by taxonomy
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom Form / Search with Custom Post Type Data
- php dynamic content inside shortcode
- update custom taxonomy custom fields
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Check that a slug is present in the get_terms request
- Pagination not working in custom post type. Help
- How to add specific terms in a custom post type?
- Assigning categories to custom post types via a front-end form; only works for native post type
- Sort custom post column by generated value?
- Limit custom post type to the authors only on front-end!
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- wp_post_delete is deleting all offices
- Create posts inside CPT post
- Persist meta box choices throughout all posts of same post type
- ACF field check value of field on all other articles
- Tell wordpress to show a single page instead of an archive page
- Search result based on URL
- Change Search display for Custom Post Type
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Taxonomy – fields
- Custom Post By Category
- Stored meta from attachment, video length?
- How to get the posts that my following users are liked?
- CPT post doesnt shows tags and category on backend admin page
- Duplicate posts in my custom loop
- The most recent post of custom taxonomy
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Featured image in custom post is being disabled
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- can’t see categories in appearance-menu-categories
- Loop carousel slider in wordpress
- WP_Query function for custom post type
- Modify shortcode to work with custom taxonomies and slugs
- Function not pulling image or text from custom post type
- Values inside a custom field to determine which category posts to display
- WordPress multi-query not returning as expected
- Trying to combine multiple WordPress queries
- Custom Post-type not returning the right child_of
- Pagination not working on homepage
- Custom Loop for custom post type. Compare by meta_value?
- Query Custom Post Type by Tag
- Code in custom widget queries all posts, when it should only query the current post
- Add HTML before a specific div?
- How to manage wordpress knowledge base/wiki/posts collections
- How to string lines from the_content() hook in WordPress?
- Comments are not working on Custom Post Type